小编Fra*_*ank的帖子

将UITabBarItems添加到UITabBar

我希望有人能解释我如何做到这一点:

我有一个TabBar和两个TabBarItems,我如何将项目附加到TabBar.我不是通过IB做这个,因为TabBar只适合屏幕,因为项目应该在左侧.

多数民众赞成我如何建立它们:

tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
tabBarController2 = [[UITabBarController alloc] initWithNibName:nil bundle:nil];

tabBarController.tabBar.frame = CGRectMake(0, 974, 384, 50);    
tabBarController2.tabBar.frame = CGRectMake(384, 974, 384, 50);

UITabBarItem *tbi1 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostViewed tag:0];
UITabBarItem *tbi2 = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemMostViewed tag:1];
Run Code Online (Sandbox Code Playgroud)

uitabbarcontroller uitabbaritem ipad

2
推荐指数
1
解决办法
4184
查看次数

标签 统计

ipad ×1

uitabbarcontroller ×1

uitabbaritem ×1