gpt4 book ai didi

ios - UITabBarController 不能在 iphone 5 模拟器上工作,我正在使用 xib,所以没有 mainwindow.xib

转载 作者:行者123 更新时间:2023-11-28 18:06:34 25 4
gpt4 key购买 nike

我添加了代码来制作具有导航功能的标签栏应用程序。

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization




ChatVC *objChatVC = [[ChatVC alloc]init];
UpdateMeContactVC *objUpdateMeContact = [[UpdateMeContactVC alloc]init];
cardsVC *objCardsVC = [[cardsVC alloc]init];
settingVC *objSettingVC = [[settingVC alloc]init];
NotificationVC *objNotificationVC = [[NotificationVC alloc]init];

self.objNavConChat = [[UINavigationController alloc]initWithRootViewController:objChatVC];
self.objNavConContact = [[UINavigationController alloc]initWithRootViewController:objUpdateMeContact];
self.objNavConCards = [[UINavigationController alloc]initWithRootViewController:objCardsVC];
self.objNavConNotification = [[UINavigationController alloc]initWithRootViewController:objNotificationVC];
self.objNavConSetting = [[UINavigationController alloc]initWithRootViewController:objSettingVC];
self.objTabBarController = [[UITabBarController alloc]init];

self.objNavConChat.title = @"Chat";
self.objNavConContact.title = @"Contacts";
self.objNavConCards.title = @"Cards";
self.objNavConNotification.title = @"Notification";
self.objNavConSetting.title = @"Setting";

self.objNavConChat.tabBarItem.image = [UIImage imageNamed:@"online_chat.png"];
self.objNavConCards.tabBarItem.image = [UIImage imageNamed:@"card.png"];
self.objNavConContact.tabBarItem.image = [UIImage imageNamed:@"contact.png"];
self.objNavConNotification.tabBarItem.image = [UIImage imageNamed:@"notification.png"];
self.objNavConSetting.tabBarItem.image = [UIImage imageNamed:@"settings.png"];


objTabBarController.viewControllers = [NSArray arrayWithObjects:objNavConChat,objNavConCards,objNavConContact,objNavConNotification,objNavConSetting, nil];
objTabBarController.selectedIndex=2;
[self.view addSubview:self.objTabBarController.view];





}
return self;
}

在 updatemecontact 中我使用的是 tableviewon scrollview我的 xib 是 3.5 英寸,但是当我运行程序时,标签栏不起作用。我无法在标签栏上选择任何选项。

最佳答案

转到 MainWindow.xib,选择 Window 对象并选中“启动时全屏”。

enter image description here

关于ios - UITabBarController 不能在 iphone 5 模拟器上工作,我正在使用 xib,所以没有 mainwindow.xib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13560570/

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