Re: Transparent Image with Tint Color
Sent from my iPhone On 2013/09/30, at 11:37, Paul Scott psc...@skycoast.us wrote: On Sep 29, 2013, at 6:54 PM, Kyle Sluder k...@ksluder.com wrote: How do I get an image rendered in the tint color? Start a bitmap context, set your template image as the image mask, set the full color to the appropriate tintColor, and fill the bounds of the context. Construct a data URI out of the image you get by closing the bitmap context. That works. Thanks. I was already heading down that path, since it seemed kind of obvious after thinking about it. Nevertheless, there are some strange and non-obvious dependencies that exist with various Cocoa and CG objects that aren't particularly well documented, such as [colorObject setFill]; I mean, what kind of magic happens there? Normally, I'd expect an instance method to operate on the receiver; but by this incantation the graphics context is involved. Yes this is unusual in Cocoa and Cocoa touch. I thought the same thing the first time. These are actually Objective-C wrappers around Core Graphics (Quartz) functions. They mainly make sense when you learn about how CG works and that these are actually setting parameters of the graphics state of the current graphics context in Quartz. Unfortunately it's a winding road to learn and know this. I recommend highly the dates but still VERY well explained book Programming With Quartz: 2D and PDF Graphics in Mac OS X Yes, I've got some learning ahead of me. In any case, for anyone who cares, this code (in the webViewDidFinishLoad: method) worked: UIImage *image = [controller.infoIcon.image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; UIGraphicsBeginImageContext(image.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGRect rect = CGRectMake(0, 0, image.size.width, image.size.height); CGContextSetBlendMode(context, kCGBlendModeNormal); CGContextDrawImage(context, rect, image.CGImage); CGContextSetBlendMode(context, kCGBlendModeColor); [[webView tintColor] setFill]; CGContextFillRect(context, rect); CGContextSetBlendMode(context, kCGBlendModeDestinationIn); CGContextDrawImage(context, rect, image.CGImage); image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSString *data = [UIImagePNGRepresentation(image) base64EncodedStringWithOptions:nil]; [webView stringByEvaluatingJavaScriptFromString: [NSString stringWithFormat:@%@%@%@, @( function() { @var x = document.getElementById('infoIcon'); @if ( !! x ) { @x.src = 'data:image/png;base64,, data, @'; @} @})(); ] ]; Paul __ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Efficient UITableViewCell usage
Hi, I have a custom UITableViewCell with several labels of which the size needs to be calculated based on the content. Some of the content is also constructed on the fly, since I am generating an attributed string, and don't want to store these in my model objects. The frame is calculated in heightForRowAtIndexPath: and layoutSubviews of my custom cell. The attributed string is calculated in heightForRowAtIndexPath: and cellForRowAtIndexPath: I put in some logs to see the order in which these methods are called, see below. Surprisingly (at least for me), heightForRowAtIndexPath is called for every row first, even the ones that are not yet visible. So when my data array is really large, this could take up some time, and I can see that when the table is drawn. There must be a more clever way to do this? - Koen. 2013-09-30 09:50:30.674 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.675 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.676 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.677 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.677 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.678 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.679 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.680 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.680 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.681 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.682 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.683 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.683 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.684 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.685 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.686 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.686 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.687 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.688 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.688 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.689 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.690 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.691 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.691 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.692 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.693 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.693 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.694 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.695 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.696 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.697 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.697 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.698 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.699 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.700 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.701 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.701 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.702 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.703 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.704 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.704 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.705 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.706 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.707 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.707 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.708 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.709 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.709 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.727 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.729 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.731 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.732 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.734 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.735 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.737 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.738 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.739 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.740 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.741 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.741 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.742 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.743 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.754 MyApp[23200:a0b] layoutsubviews ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or
Re: Efficient UITableViewCell usage
On 30 Sep 2013, at 15:47, Koen van der Drift koenvanderdr...@gmail.com wrote: Hi, I have a custom UITableViewCell with several labels of which the size needs to be calculated based on the content. Some of the content is also constructed on the fly, since I am generating an attributed string, and don't want to store these in my model objects. The frame is calculated in heightForRowAtIndexPath: and layoutSubviews of my custom cell. The attributed string is calculated in heightForRowAtIndexPath: and cellForRowAtIndexPath: I put in some logs to see the order in which these methods are called, see below. Surprisingly (at least for me), heightForRowAtIndexPath is called for every row first, even the ones that are not yet visible. So when my data array is really large, this could take up some time, and I can see that when the table is drawn. There must be a more clever way to do this? The table has to know how high each row is in order to know how tall it is in total. That information is needed for the scroll indicator. I believe iOS 7 introduces the concept of an estimated height, allowing you to give it a quicker calculation, which later gets refined. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Efficient UITableViewCell usage
On Sep 30, 2013, at 11:06 AM, Steve Christensen puns...@me.com wrote: For performance, you could calculate and cache the cell heights in an array managed by your view controller, then just return the cached values. Thanks, I thought about that too. Problem is I have multiple sections, and am using a search bar, so I think I cannot use a straightforward array. I'll look into it. - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Efficient UITableViewCell usage
The table view needs to call -heightForRowAtIndexPath: for each cell in the table, at the very least, so that it knows how tall the table is so that it can set -contentSize on it's underlying scroll view. For performance, you could calculate and cache the cell heights in an array managed by your view controller, then just return the cached values. If you calculate them in your view controller's -viewWillLayoutSubviews method then you can adjust the heights when the screen rotation changes. Sent from my iPhone On Sep 30, 2013, at 7:47 AM, Koen van der Drift koenvanderdr...@gmail.com wrote: Hi, I have a custom UITableViewCell with several labels of which the size needs to be calculated based on the content. Some of the content is also constructed on the fly, since I am generating an attributed string, and don't want to store these in my model objects. The frame is calculated in heightForRowAtIndexPath: and layoutSubviews of my custom cell. The attributed string is calculated in heightForRowAtIndexPath: and cellForRowAtIndexPath: I put in some logs to see the order in which these methods are called, see below. Surprisingly (at least for me), heightForRowAtIndexPath is called for every row first, even the ones that are not yet visible. So when my data array is really large, this could take up some time, and I can see that when the table is drawn. There must be a more clever way to do this? - Koen. 2013-09-30 09:50:30.674 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.675 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.676 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.677 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.677 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.678 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.679 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.680 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.680 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.681 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.682 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.683 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.683 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.684 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.685 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.686 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.686 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.687 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.688 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.688 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.689 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.690 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.691 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.691 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.692 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.693 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.693 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.694 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.695 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.696 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.697 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.697 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.698 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.699 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.700 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.701 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.701 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.702 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.703 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.704 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.704 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.705 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.706 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.707 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.707 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.708 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.709 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.709 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.727 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.729 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.731 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.732 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.734 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.735
Re: Efficient UITableViewCell usage
Just a small note: The height is called for all the data to determine the scroller size. On 30.09.2013 16:47, Koen van der Drift wrote: Hi, I have a custom UITableViewCell with several labels of which the size needs to be calculated based on the content. Some of the content is also constructed on the fly, since I am generating an attributed string, and don't want to store these in my model objects. The frame is calculated in heightForRowAtIndexPath: and layoutSubviews of my custom cell. The attributed string is calculated in heightForRowAtIndexPath: and cellForRowAtIndexPath: I put in some logs to see the order in which these methods are called, see below. Surprisingly (at least for me), heightForRowAtIndexPath is called for every row first, even the ones that are not yet visible. So when my data array is really large, this could take up some time, and I can see that when the table is drawn. There must be a more clever way to do this? - Koen. 2013-09-30 09:50:30.674 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.675 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.676 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.677 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.677 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.678 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.679 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.680 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.680 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.681 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.682 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.683 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.683 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.684 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.685 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.686 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.686 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.687 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.688 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.688 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.689 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.690 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.691 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.691 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.692 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.693 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.693 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.694 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.695 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.696 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.697 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.697 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.698 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.699 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.700 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.701 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.701 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.702 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.703 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.704 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.704 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.705 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.706 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.707 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.707 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.708 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.709 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.709 MyApp[23200:a0b] heightForRowAtIndexPath 2013-09-30 09:50:30.727 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.729 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.731 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.732 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.734 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.735 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.737 MyApp[23200:a0b] cellForRowAtIndexPath 2013-09-30 09:50:30.738 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.739 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.740 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.741 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.741 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.742 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.743 MyApp[23200:a0b] layoutsubviews 2013-09-30 09:50:30.754 MyApp[23200:a0b] layoutsubviews
Dealing with the iOS 7 status bar
I had to go through some gymnastics to get a UIToolbar at the top of the screen to play nicely with the status bar in an app I'm working on. In a sample app I'm trying to build for a bug report, I'm having the same issue, and it seems like I must be doing something wrong. I created a single-view iPad app, and put a UIToolbar at the top of the view. Running this results in a status bar that overlaps elements on the toolbar. There is no obvious setting in IB to correct this. Is this only solvable by setting up a UIToolbar delegate and implementing -positionForBar: (or some other programmatic means)? -- Rick signature.asc Description: Message signed with OpenPGP using GPGMail ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Dealing with the iOS 7 status bar
On Mon, Sep 30, 2013, at 12:21 PM, Rick Mann wrote: Is this only solvable by setting up a UIToolbar delegate and implementing -positionForBar: (or some other programmatic means)? The documentation for UIBarPositioning sure implies that this is how you accomplish your goal: https://developer.apple.com/library/ios/documentation/uikit/reference/UIBarPositioning_Protocol/Reference/Reference.html#//apple_ref/doc/c_ref/UIBarPosition In particular, note that it works by _extending the background_. That means you should still align the top of your toolbar to the top layout guide, not to the top of the screen. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Dealing with the iOS 7 status bar
Thanks, Kyle. On Sep 30, 2013, at 12:29 , Kyle Sluder k...@ksluder.com wrote: On Mon, Sep 30, 2013, at 12:21 PM, Rick Mann wrote: Is this only solvable by setting up a UIToolbar delegate and implementing -positionForBar: (or some other programmatic means)? The documentation for UIBarPositioning sure implies that this is how you accomplish your goal: https://developer.apple.com/library/ios/documentation/uikit/reference/UIBarPositioning_Protocol/Reference/Reference.html#//apple_ref/doc/c_ref/UIBarPosition In particular, note that it works by _extending the background_. That means you should still align the top of your toolbar to the top layout guide, not to the top of the screen. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com This email sent to rm...@latencyzero.com -- Rick signature.asc Description: Message signed with OpenPGP using GPGMail ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Dealing with the iOS 7 status bar
On Sep 30, 2013, at 12:29 , Kyle Sluder k...@ksluder.com wrote: On Mon, Sep 30, 2013, at 12:21 PM, Rick Mann wrote: Is this only solvable by setting up a UIToolbar delegate and implementing -positionForBar: (or some other programmatic means)? The documentation for UIBarPositioning sure implies that this is how you accomplish your goal: https://developer.apple.com/library/ios/documentation/uikit/reference/UIBarPositioning_Protocol/Reference/Reference.html#//apple_ref/doc/c_ref/UIBarPosition In particular, note that it works by _extending the background_. That means you should still align the top of your toolbar to the top layout guide, not to the top of the screen. I can't figure out how to set this constraint in IB. -- Rick signature.asc Description: Message signed with OpenPGP using GPGMail ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com