gpt4 book ai didi

iphone - UITabbarController + ABPeoplePickerNavigationController 无法正常工作

转载 作者:行者123 更新时间:2023-11-29 13:45:31 25 4
gpt4 key购买 nike

目前我正在使用 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];
}

但是当我写这段代码的时候,突然标签栏的标题从联系人变成了组,并且图像不显示..

我们如何像以前一样显示此标签栏的标题和图像....

请帮我解决这个问题..

提前致谢...

最佳答案

请把这段代码写在你的

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

之后的方法

[self.window addSubview:tabBarController.view];

UITabBarItem *tabItem = [[[self.tabBarController tabBar] items] objectAtIndex:TAB_INDEX];
[tabItem setTitle:@"Contacts"];
tabItem.image = [UIImage imageNamed:@"YOUR IMAGE"];

快乐编码....

关于iphone - UITabbarController + ABPeoplePickerNavigationController 无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7593786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com