Reputation: 3288
I have usually placed tab bar on its as usual bottom I have used following code in application didFinishLaunchingWithOptions
for that.
MemberVC *MemberTabBar = [[MemberVC alloc]init];
UINavigationController *navMember = [[UINavigationController alloc] initWithRootViewController:MemberTabBar];
MemberTabBar.tabBarItem.title = @"Member";
MemberTabBar.tabBarItem.image = [[UIImage imageNamed:@"home_icon.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
MemberTabBar.tabBarItem.selectedImage = [[UIImage imageNamed:@"home_icon.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
-----------------------
self.tabBarController = [[UITabBarController alloc]init];
self.tabBarController.viewControllers = @[navMember,navEvent,navPromo,navProfile,navAbout];
self.window.rootViewController = tabBarController;
tabBarController.selectedIndex = 0;
I haver found one source to place it in top but i want to find out the better way. I have gained some knowledge about how to place in top from following git projects. If any one knows some better way then i will be glad to know about that https://github.com/hollance/MHTabBarController
How to place tab bar on top of screen in iPhone
Upvotes: 0
Views: 2901
Reputation: 539
You cannot move the TabBar to the top. You'll have to create custom one. Check this article about customizing tab bar:
http://idevrecipes.com/2011/01/04/how-does-the-twitter-iphone-app-implement-a-custom-tab-bar/
Basing on it you may move the custom tab bar to the top and acheive desired result
Upvotes: 1