我正在使用故事板在Xcode 5中为ios 7开发应用程序,用户使用push segue将其推送到带有2个UIViewControllers"在其中的UITabBarController"。 Here's ViewControllers上的裁剪截图。
我在UITabBarController中获得了这段代码:
#import "ViewTVTabBarController.h"
#import "MyManager.h"
@interface ViewTVTabBarController ()
@end
@implementation ViewTVTabBarController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
// Set the BarTintcolor to red and text colors to white
self.navigationController.navigationBar.barTintColor = [UIColor redColor];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:UITextAttributeTextColor];
// Set the NavigationItem Title
self.navigationItem.title = [[MyManager sharedManager] selectedTV];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)actionBarButton:(id)sender {
// Offer options for this TV; options like delete, edit, etc
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
另外2个"正常" UIViewControllers作为2个选项卡。标题没有设置,NSLog也不会触发。
我做错了什么?
谢谢! 埃里克
答案 0 :(得分:0)
至于问题
我做错了什么?
我想也许答案就是设计。尝试在UIToolBar
中使用UISegmentedControl
或UIViewController
来替换将被推入的UITabBarController
。或者在UITabBarController