Re: uitabbar translucency and hiding
Re: uitabbar translucency and hiding
- Subject: Re: uitabbar translucency and hiding
- From: Scott Ahten <email@hidden>
- Date: Mon, 22 Aug 2016 11:42:42 -0400
> On Aug 20, 2016, at 7:29 PM, Torsten Curdt <email@hidden> wrote:
>
> Now I would like to hide the UITabBar (on action).
Hello, Torsten.
Can you elaborate further on your use case and what problem you are trying to solve?
I would suggest you have found this difficult because a UITabBarController does not sound like an appropriate UI element for your use case. Specially, what you're describing is using a tab as an action, rather than navigation (or both navigation and an action), and the action of hiding the tab bar is one the user will not expect if they are familiar with Apple's apps, and other human interface guidelines (HIG) compliant apps from third parties.
Since the tab bar view controller is a view controller container, it manages the frame of its child view controller's views. Attempts to change them manually will likely be unsuccessful as the tab bar controller has other ideas (compliant with Apple's HIG) of what the frame should be and will likely disagree with you. For example, the child view controller's frame is inset to allow scroll bars to show the entire content without being covered by the tab bar. So, when you hide it, there is an empty space. Manually adjusting the frame of that view will only temporarily be successful, at best.
If you are looking for buttons to perform actions, perhaps a navigation controller with toolbar with bar button items is more appropriate? As of iOS 8, toolbar and navigation bars can be hidden in an animated fashion to provide a full screen experience programmatically or via gestures, similar to that in Safari. Since you were planning on hiding the tab bar, the lack of a selected icon in the toolbar might not be a problem. Instead of using a toolbar, you can subclass UINavigation controller and adding you own custom views to the bottom. In both cases, you can switch to a different view controller by calling setViewControllers:animated with an array that contains just the target view controller, passing NO for the animated parameter.
At the extreme end of the spectrum, you can create a custom view controller container class with a set of views that specifically meet your needs without looking like a tab bar controller - therefore avoiding confusion since it would not behave like one.
- Scott
_______________________________________________
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