Re: Toolbar hiding on rotation?
Re: Toolbar hiding on rotation?
- Subject: Re: Toolbar hiding on rotation?
- From: Alex Kac <email@hidden>
- Date: Mon, 29 Aug 2016 11:37:48 -0600
I figured it out :) Maybe its just monday morning fresh brain, I don’t know.
It turns out that the issue was that I am using a UISplitViewController AND the delegate methods:
-(UIViewController *)primaryViewControllerForCollapsingSplitViewController:(UISplitViewController *)splitViewController
I was passing the view controller itself - not its parent navigation controller.
> On Aug 29, 2016, at 11:29 AM, Alex Kac <email@hidden> wrote:
>
> I thought so as well. This is a pretty major project - 1600 classes, Mac/iOS targets, and several third party libraries - so its quite possible somewhere somehow there is something I’m unaware of, but that’s why I’m asking for help in leads. I would think if its my code or even third party code, somewhere “setToolbarHidden:” or “setTOolbarHidden:animated:” would be called, but its not. Only other way I can think of it going away is some internal UIKit methods or someone traversing the view hierarchy and removing the toolbar view itself.
>
> Relevant code:
>
> to show the toolbar:
> navController.toolbarHidden = false
>
> class PIMainViewNavigationController: UINavigationController {
> }
>
> literally empty subclass because we look for specific view controllers that are this class name (easy filter). However if I get rid of this class and just use UINavigationController, I still have the same problem. No other extensions on UINavigationController that *I*’m using.
>
> I’m pretty certain its some code somewhere doing this then…I just can’t figure out what. So I’m hoping perhaps someone else has an idea where else to look so I can identify it? Maybe I should try putting a breakpoint on removeFromSuperview?
>
>> On Aug 29, 2016, at 11:06 AM, David Duncan <email@hidden> wrote:
>>
>>
>>> On Aug 29, 2016, at 9:57 AM, Alex Kac <email@hidden> wrote:
>>>
>>> I have a UINavigationController and UIViewController root that I set the toolbarItems on. I obviously also tell it not to hide the toolbar. Great! Works perfectly. But when I rotate, the toolbar is hidden - even if I rotate back to portrait. I've set all the "hides*" properties such as hidesBarsWhenVerticallyCompact to false (they were already false - but I tried anyway), and it still hides the toolbar. I’ve put breakpoints everywhere including symbolic ones for the toolbar hidden properties/methods in UIKit. Since we are using a navigationcontroller subclass, I even tried overriding the toolbar methods so that they can't get set to true (hiding that is) and it still hides the toolbar.
>>>
>>> In some ways, I'm okay with it hiding going in landscape, but I'm not OK with it not coming back when you go to portrait. The view debugger also shows the toolbar is completely gone. So something in UIKit is removing the toolbar view and never bringing it back - nothing I do can bring it back. This is obviously disconcerting. My next step will be to just creating my own toolbar instead of using Apple’s navcontroller toolbar, but if I can get it to work, that’s my preference.
>>>
>>> Any ideas?
>>
>> This sounds suspect, as this is not the default behavior at all – that is, you can create a brand new project and configure a navigation controller to show the toolbar and it won’t hide it on its own.
>>
>> What methods are you using to hide/show the toolbar? What other overrides are on your subclass? Any other libraries you have in your project, or categories on UINavigationController?
>>
>> --
>> David Duncan
>>
>
>
> Alex Kac - El capitán
>
Alex Kac - El capitán
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden