UIViewController *newView = [[UIViewController alloc] initWithNibName:@"NewView" bundle:[NSBundle mainBundle]];
tabBarController.selectedViewController = newView;
为什么这行不通?
最佳答案
UITabBarController 的 selectedViewController 属性必须是选项卡栏的现有选项卡之一(在其 viewControllers 属性中定义)。您可能想要将新 Controller 推送到现有选项卡(必须是 UINavigationController),或者将 viewController 添加到 viewControllers 数组。
关于iphone - 在 uitabbar 应用程序 iOS iPad 中更改当前 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3697363/