Reputation: 65
How to customize tab bar controller so that tabs appear on the top of the screen?Tabs should not appear at bottem of the screen.
Upvotes: 1
Views: 2601
Reputation: 247
Try this,
self.tabBarController.tabBar.frame=CGRectMake(0, 0, 320, 70);
Upvotes: 2
Reputation: 16337
Tabs should not appear at bottem of the screen.
Actually, according to the iOS human interface guidelines, they should:
A tab bar appears at the bottom edge of the screen and should be accessible from every location in the application.
If you really wanted to do what you are asking, you could use a UITabBar
directly (not touching UITabBarController
). That handles drawing the tab bar itself, but doesn't do any view swapping for you. You should then write a custom container view controller using the view controller containment APIs (iOS 5 only) which you set as a delegate method on your tab bar, and then when the user changes tab, you swap in and out the relevant views.
Or you could use this open source version.
Don't make your top tab bar look like a standard Apple tab bar though, because they'll probably reject it from review. If you use a completely custom look you should be fine.
Upvotes: 0
Reputation: 50707
You will need to create a custom control. The standard UITabBar does not offer the option to place tabs at the top unfortunately.
Upvotes: 0