Re: uitabbar translucency and hiding
Re: uitabbar translucency and hiding
- Subject: Re: uitabbar translucency and hiding
- From: Torsten Curdt <email@hidden>
- Date: Mon, 22 Aug 2016 23:45:47 +0200
Hey Scott
> 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.
>
Hm. Sounds like I might have given a wrong impression here? I don't see how
a fullscreen controller is in violation of the HIG. The challenge I am
facing is only how to get there in my app setup.
It's a tab based app. In one of the tabs there is a controller that needs
to go fullscreen at some stage. The problem is that the view controller has
a webview - so I cannot easily just re-create it and present it as a modal
view controller.
So to gain a fullscreen experience in this situation I see two possible
options (at this time of writing):
1. Hide the tab bar (The original start of this post)
2. Present a modal view controller that has the original view controller
instance as a child controller. (Untested at this stage)
> Since the tab bar view controller is a view controller container, it
> manages the frame of its child view controller's views.
>
Certainly.
> 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.
>
The idea was to the hide the bar and tell the UITabBarController to do a
re-layout. It does know about the scenario of the two different content
sizes already. If you set the UITabBar translucent property at application
start the UITabController does the right thing for both cases.
So the problem could also be seen as changing the translucency of UITabBar
of a UITabBarController at runtime. Unfortunately a change of the property
does not trigger the required re-layout.
... Manually adjusting the frame of that view will only temporarily be
> successful, at best.
>
Certainly - but since the UITabBarController already knows about those two
content sizes. (translucent and non-translucent UITabBar - which is even
accessible through the appearance proxy) It should be merely a question of
re-layouting.
If you are looking for buttons to perform actions, perhaps a navigation
> controller with toolbar with bar button items is more appropriate?
>
I am not. It's a classic tab bar navigation. Just one controller wants to
go fullscreen at some stage.
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.
>
Hm. Maybe that's an option, too. But I then would really abuse a toolbar to
be a tab bar. It really is a navigation - not actions.
Since you were planning on hiding the tab bar, the lack of a selected icon
> in the toolbar might not be a problem.
>
No - I really have separate tabs.
> Instead of using a toolbar, you can subclass UINavigation controller and
> adding you own custom views to the bottom.
>
But I have multiple tabs - each have their UINavigationController. So that
doesn't sound right. Writing my own UITabBarController is of course an
option, too. But I would love to avoid that.
> 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.
>
Indeed.
cheers,
Torsten
_______________________________________________
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