Re: Hide UINavigationBar and keep UIPageController content static
On Tue, Oct 27, 2015, at 11:49 AM, Stevo Brock wrote: > Hi David and Kyle, > > Thanks so much for the insight and pointers. > > I was manually calling setNeedsDisplay() when toggling the navigation bar > hidden, and now I can remove that and just set the contentMode to > .Redraw. That’s great. > > And setting the automaticallyAdjustsScrollViewInsets to false helps, and > I can now go back to drawing the content under the top bars and the > content stays put while the bar animates up and down. > > Thanks again guys for your expert insight. You're welcome. You can pay me back by filing a bug about this issue with an attached sample project. :P --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: Hide UINavigationBar and keep UIPageController content static
Hi David and Kyle, Thanks so much for the insight and pointers. I was manually calling setNeedsDisplay() when toggling the navigation bar hidden, and now I can remove that and just set the contentMode to .Redraw. That’s great. And setting the automaticallyAdjustsScrollViewInsets to false helps, and I can now go back to drawing the content under the top bars and the content stays put while the bar animates up and down. Thanks again guys for your expert insight. -Stevo Brock Owner Sunset Magicwerks, LLC www.sunsetmagicwerks.com @SunsetMagicwrks 818-478-9758 > On Oct 25, 2015, at 10:09 AM, David Duncan wrote: > > >> On Oct 24, 2015, at 10:23 AM, Kyle Sluder wrote: >> >> On Tue, Oct 20, 2015, at 11:21 AM, Stevo Brock wrote: >>> The trick is, if in the storyboard, on the UIPageController, I set the >>> “Under Top Bars” to yes, my custom view draws full screen. But when I >>> toggle the navigationBarHidden, the custom view and its superview scroll >>> up and down the size of the navigation bar. >> >> This sounds like it might be a bug in automatic content inset >> adjustment. Please file a Radar with a sample project. >> >> In the meantime, you can try turning off >> automaticallyAdjustsScrollViewInsets on your view controller and >> managing layout manually (relative to the view controller's >> topLayoutGuide) in an override of -viewDidLayoutSubviews. >> >>> >>> >>> Alternatively, if in the storyboard, on the UIPageController, I set the >>> “Under Top Bars” to no, my custom view draws in the screen space under >>> the navigation bar. When I toggle the navigationBarHidden, the view >>> stretches to fill the full height of the screen, but I never get a redraw >>> call, so the drawing is stretched. >> >> This is expected. Views that need to redraw when they change size should >> override -setBounds: to call [self setNeedsDisplay]. > > If you need to redraw on bounds change, change the contentMode to Redraw. > Overriding -setBounds: is insufficient and unnecessary. > >> >> --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/david.duncan%40apple.com >> >> This email sent to david.dun...@apple.com > > -- > David Duncan > > > ___ > > 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/devlists%40sunsetmagicwerks.com > > This email sent to devli...@sunsetmagicwerks.com ___ 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: Hide UINavigationBar and keep UIPageController content static
> On Oct 24, 2015, at 10:23 AM, Kyle Sluder wrote: > > On Tue, Oct 20, 2015, at 11:21 AM, Stevo Brock wrote: >> The trick is, if in the storyboard, on the UIPageController, I set the >> “Under Top Bars” to yes, my custom view draws full screen. But when I >> toggle the navigationBarHidden, the custom view and its superview scroll >> up and down the size of the navigation bar. > > This sounds like it might be a bug in automatic content inset > adjustment. Please file a Radar with a sample project. > > In the meantime, you can try turning off > automaticallyAdjustsScrollViewInsets on your view controller and > managing layout manually (relative to the view controller's > topLayoutGuide) in an override of -viewDidLayoutSubviews. > >> >> >> Alternatively, if in the storyboard, on the UIPageController, I set the >> “Under Top Bars” to no, my custom view draws in the screen space under >> the navigation bar. When I toggle the navigationBarHidden, the view >> stretches to fill the full height of the screen, but I never get a redraw >> call, so the drawing is stretched. > > This is expected. Views that need to redraw when they change size should > override -setBounds: to call [self setNeedsDisplay]. If you need to redraw on bounds change, change the contentMode to Redraw. Overriding -setBounds: is insufficient and unnecessary. > > --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/david.duncan%40apple.com > > This email sent to david.dun...@apple.com -- David Duncan ___ 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: Hide UINavigationBar and keep UIPageController content static
On Tue, Oct 20, 2015, at 11:21 AM, Stevo Brock wrote: > The trick is, if in the storyboard, on the UIPageController, I set the > “Under Top Bars” to yes, my custom view draws full screen. But when I > toggle the navigationBarHidden, the custom view and its superview scroll > up and down the size of the navigation bar. This sounds like it might be a bug in automatic content inset adjustment. Please file a Radar with a sample project. In the meantime, you can try turning off automaticallyAdjustsScrollViewInsets on your view controller and managing layout manually (relative to the view controller's topLayoutGuide) in an override of -viewDidLayoutSubviews. > > > Alternatively, if in the storyboard, on the UIPageController, I set the > “Under Top Bars” to no, my custom view draws in the screen space under > the navigation bar. When I toggle the navigationBarHidden, the view > stretches to fill the full height of the screen, but I never get a redraw > call, so the drawing is stretched. This is expected. Views that need to redraw when they change size should override -setBounds: to call [self setNeedsDisplay]. --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
Hide UINavigationBar and keep UIPageController content static
I have what I hope to be an easy-to-solve situation, but so far that solution has been elusive. Rather basic setup… UIPageController subclass in a storyboard. All I have in the storyboard is the UIPageController and its associated Navigation Item. In UIPageController viewDidLoad, I create a number of custom UIViews. I also create a generic UIViewController for each one, set the viewController.view = myCustomView and store all the view controllers in an array. The appropriate UIPageController methods return the right view controller. Now, I also have a UITapGestureRecognizer that toggles the containing UINavigationController’s navigationBarHidden. The trick is, if in the storyboard, on the UIPageController, I set the “Under Top Bars” to yes, my custom view draws full screen. But when I toggle the navigationBarHidden, the custom view and its superview scroll up and down the size of the navigation bar. Alternatively, if in the storyboard, on the UIPageController, I set the “Under Top Bars” to no, my custom view draws in the screen space under the navigation bar. When I toggle the navigationBarHidden, the view stretches to fill the full height of the screen, but I never get a redraw call, so the drawing is stretched. For this application, I don’t care whether the content stays full screen always, or dynamically resizes with the navigation bar animation, I just can’t get either of them to work cleanly. I’m guessing my solution has something to do with constraints, where the rest of the application is fully using auto-layout, but this screen is not using auto-layout at all, but I’m currently at a loss as to what would need to go where. Any help is much appreciate! -Stevo Brock Owner Sunset Magicwerks, LLC www.sunsetmagicwerks.com @SunsetMagicwrks 818-478-9758 ___ 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
Hide UINavigationBar and keep UIPageController content static
I have what I hope to be an easy-to-solve situation, but so far that solution has been elusive. Rather basic setup… UIPageController subclass in a storyboard. All I have in the storyboard is the UIPageController and its associated Navigation Item. In UIPageController viewDidLoad, I create a number of custom UIViews. I also create a generic UIViewController for each one, set the viewController.view = myCustomView and store all the view controllers in an array. The appropriate UIPageController methods return the right view controller. Now, I also have a UITapGestureRecognizer that toggles the containing UINavigationController’s navigationBarHidden. The trick is, if in the storyboard, on the UIPageController, I set the “Under Top Bars” to yes, my custom view draws full screen. But when I toggle the navigationBarHidden, the custom view and its superview scroll up and down the size of the navigation bar. Alternatively, if in the storyboard, on the UIPageController, I set the “Under Top Bars” to no, my custom view draws in the screen space under the navigation bar. When I toggle the navigationBarHidden, the view stretches to fill the full height of the screen, but I never get a redraw call, so the drawing is stretched. For this application, I don’t care whether the content stays full screen always, or dynamically resizes with the navigation bar animation, I just can’t get either of them to work cleanly. I’m guessing my solution has something to do with constraints, where the rest of the application is fully using auto-layout, but this screen is not using auto-layout at all, but I’m currently at a loss as to what would need to go where. Any help is much appreciate! -Stevo Brock Owner Sunset Magicwerks, LLC www.sunsetmagicwerks.com @SunsetMagicwrks 818-478-9758 ___ 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