UITabbarController + ABPeoplePickerNavigationController 无法正常工作
目前我正在使用 ABPeoplePickerNavigationController 和 UITabbarController 并希望在 UITabbarController 的索引 2 中打开 ABPeoplePickerNavigationController 。
所以在索引 2 的 viewcontroller 上,我编写了这样的代码,
-(void)awakeFromNib
{
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
NSMutableArray *newControllers = [NSMutableArray arrayWithArray: [self.tabBarController viewControllers]];
[picker.navigationBar setBarStyle:UIBarStyleBlackOpaque];
[newControllers replaceObjectAtIndex:2 withObject: picker];
[self.tabBarController setViewControllers: newControllers animated: NO];
[picker release];
}
但是当我编写此代码时,选项卡栏的标题突然从联系人更改为组和图像未显示..
我们如何像以前一样显示此选项卡栏的标题和图像....
请帮助我解决这个问题..
提前致谢...
Currently I am using ABPeoplePickerNavigationController along with UITabbarController and want to open ABPeoplePickerNavigationController in UITabbarController's index 2..
So on viewcontroller at index 2, I had written code like this,
-(void)awakeFromNib
{
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
NSMutableArray *newControllers = [NSMutableArray arrayWithArray: [self.tabBarController viewControllers]];
[picker.navigationBar setBarStyle:UIBarStyleBlackOpaque];
[newControllers replaceObjectAtIndex:2 withObject: picker];
[self.tabBarController setViewControllers: newControllers animated: NO];
[picker release];
}
but when I had written this code, suddenly the title of tabbar changed from contacts to Groups and image not showing..
How can we show the title and image for this tabbar as before....
Please help me to solve this problem..
Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请将此代码写入您的
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
方法中
[self.window addSubview:tabBarController.view];
快乐编码....
Please write this code in your
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
method after
[self.window addSubview:tabBarController.view];
Happy Coding....