Is there a way to adjust the width of UITabBar button items to fit more than 5 buttons on the screen? - ios

My buttons seem stretched, especially in landscape orientation. I can't find a property to adjust either on the UITabBar, UITabBarViewController, or on the UITabBarItem's themselves. (Of course, one answer would be to get an iPad...but that doesn't solve the need for a phone.)
For example, consider this simple Tab Bar Example - if I only could set the tab bar to auto-shrink as more buttons are added, or manually adjust the width to fit them all on the tab bar, I would be happy.

It is not possible to use the UITabbar with more than five visible buttons. You've got to write your own component.
Here at significantpixels.com / The iPhone Tab Bar Lessons From Reality is an article about the tab bar which explains in detail how to design your tab bar from a UX point of view. And the magic number of tabs is five ;)

Related

Is there any maximum limit to show number of bottom tabbar items in iOS?

In my iOS app I want to display more than 8 items in my bottom bar like tab bar items.
For that I have used UICollectionView like tab bar at the bottom.
But one of my friends told me that Apple will reject the app if the bottom bar has more than 5 items. Is that true?
Or does that restriction only apply to UITabBar?
Please confirm. I am using UICollectionView instead of UITabBar.
It is true. The human interface guidelines say that for a bottom bar there should be around 3 to 5 items.
Yes you can make it, but for his purpose you need to make a custom tab bar, you can't use tab bar controller,
Place a UIView on top of a controller where you see view controller and exit etc. and place a view inside it and place Image view and buttons and set constraints.

UITabBar focus and moving layout of view on tvOS

One of the common behaviours of Apple's AppleTV apps (like Movies and Television Shows) is that they start with a UITabBar visible, and all of the view's content is rendered in the space below the tab bar. Once focus moves from the tab bar to some content on the screen, the tab bar slides off the top of the screen, and the content moves/scrolls up to fill in the space that's now available. This process reverses itself if the tab bar reappears.
Is there an easy way to accomplish this behaviour (like a check box or something?), or must I implement the didUpdateFocusInContext:withAnimationCoordinator: method in various places, and manually tweak the frames or scroll the content or something?
Select the Tab Bar object in the Tab Bar Controller scene in Storyboard mode and uncheck "Translucent". The items in the views should now move upwards when the tab bar moves upwards.
The UITabBar class also has a translucent property

Tab bar issue for iPad app

I'd like to display what looks like a vertical tab bar at left side as in, for example, Twitter app for iPad:
Is that a UISplitViewController with a UITabBar within its left side?
Is it a tab bar with vertical orientation (if that is possible, I couldn't find such property in UITabBar class...)?
Is it a custom tabBar-like control?
I've read some posts dealing with this (for instance, iOS vertical tab bar), that were written some time ago, does this issue remain the same?
Thanks!
Custom tabbar controls are available. I think this will fit with your requirements.

Navigation bar View Controller is twice the size as others

I have a multiple View Controllers embedded in Navigation Controller and one of my navigation bars is twice the size(extends down twice as much) as every other one. I want all of these bars to be the same size, but can't find anyway to change the size in Inspector. There are no bar buttons on this Navigation Bar. Any ideas for a quick fix w/o having to rebuild this VC?
Thanks
Default UINavigationBar have a height of 44 points and it can't be changed. I think you have a constraint issue: select your wrong sized UINavigationBar and on the top right corner, in the "utilities", select "size inspector". Then, have a look at the severals constraints, edit and/or delete some.

Simple Horizontal Button Bar for iOS

I have a requirement for a very simple Button Bar.
It should take up the width of the screen.
It should allow at least 3
buttons.
The buttons should be of equal width and together take up
the whole width of the bar.
Each button should be tappable, but not
have a selected state.
The bar will be overlaid on a MapView and positioned directly above a TabBar.
Tapping a button will launch a Modal ViewController.
I thought about using a UITabBar and not allowing its tabs to become selected, but the HIG is pretty clear that this is not correct usage and UIToolBar doesn't allow the button widths to be set.
This seems like a very simple requirement but I can't see an obvious solution. Is there something I'm missing? Can anyone suggest a solution?
What's wrong with just creating a simple view that draws an appropriate gradient, and then adding three buttons of the appropriate size?
If you're feeling ambitious, or if this is something that you're likely to use more than once, you could even have the view create the three buttons. Call it ThreeButtonBar or something. Give it a constant height and adjust the width to match that of its superview so that you can use it in portrait or landscape orientation.

Resources