How to specify width, flexible space and/or position between UITabBarItems in UITabBar?
I am working on a project when client wants UITabBar
lookalike toolbar (icons and titles) at the bottom of some views.
The tab bar needs to have 1 item at the left, empty space, and then 2 items at the right.
Do I have to use 2 extra UITabBarItem
s (and put them at second and third position) and 开发者_开发问答hide and disable them to accomplish this, or is there a more straightforward solution?
I would like to not to use UIToolBar
for this as customizing its height is a pain and causes unexpected behavior in some cases (especially when one uses modal view controllers).
I think you have the right idea. Customizing UITabBar
to do stuff out of the ordinary is often quite hard and it is better to just write your own. But in your case you should be able to just as you proposed. One way would be to add the view controllers directly in IB and then set title
to an empty string and untick enabled
for the second and third view controller.
精彩评论