【发布时间】:2010-11-06 04:12:03
【问题描述】:
好吧,这很奇怪,已经困扰我好几天了....我做对了(我认为)但是它
这一切都在 AppDelegate 中完成:
//Initialize the controllers
navController = [[UINavigationController alloc]init];
iVacationTabBar = [[UITabBarController alloc] init];
//Define the viewcontrollers
myTools* vc_tools = [[myTools alloc] init];
mySettings* vc_settings = [[mySettings alloc] init];
aboutIVacation* vc_about = [[aboutIVacation alloc] init];
myCurrent *mycurrentpage = [[myCurrent alloc] init];
//Create the array of controllers
NSArray* controllers = [NSArray arrayWithObjects:mycurrentpage, vc_tools,vc_settings, vc_about, nil];
//Add the view controllers to the tab bars:
[iVacationTabBar setViewControllers: controllers animated:YES];
//Push the first view controller to the stack:
[navController pushViewController: mycurrentpage animated:NO];
//Add the tabBar and navController to the window:
[window addSubview:iVacationTabBar.view];
[window addSubview:navController.view];
我做错了什么。我无法让页面上的任何元素正常工作。我的当前页面上有一个按钮也不起作用。
【问题讨论】:
-
您是否勾选了“启用用户交互”?
-
这些都是以编程方式完成的......有没有办法在代码中做到这一点?
-
更新:我还添加了这些 iines 希望修复它但仍然没有帮助:mycurrentpage.view.userInteractionEnabled = YES; iVacationTabBar.view.userInteractionEnabled = YES; navController.view.userInteractionEnabled = YES;
标签: iphone xcode uinavigationcontroller uitabbarcontroller