【发布时间】:2015-06-22 12:35:31
【问题描述】:
我在情节提要中使用 UITableViewController。
[self.navigationController setNavigationBarHidden:NO animated:NO];
[self.navigationItem setHidesBackButton:YES animated:YES];
UIBarButtonItem *editButton = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back2.png"] style:UIBarButtonItemStylePlain target:self action:@selector(back:)];
self.navigationItem.leftBarButtonItem = editButton;
[self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
[self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:(44/255.0f) green:(165/255.0f) blue:(264/255.0f) alpha:(1.0f)]];
[self.navigationItem setTitle:@"SETTINGS"];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
问题是我想隐藏后退按钮和标题不显示在导航栏中。相同的代码适用于 UIViewcontroller。
【问题讨论】:
-
你把这段代码放在哪里了?用什么方法?
-
如果你没有发现问题,也许只是使用一个UIViewController并在里面放一个ViewController。更改很小,UIViewController 稍后会为您提供更大的灵活性(根据我的经验..)
-
我把这段代码放在 viewWillApear 方法中。
标签: ios iphone uinavigationcontroller