mar*_*ram 12
self.navigationItem.titleView = [[UIView alloc] initWithFrame:CGRectZero];
self.title = @"Home";
设置为nil将不会如文档中所述那样工作:如果此属性值为nil,则当接收器为顶部项目时,导航项的标题将显示在导航栏的中心.如果将此属性设置为自定义标题,则会显示该属性而不是标题.
titleView是一个UIView:
titleView当此项目是顶部项目时,导航栏中心显示的自定义视图.
Run Code Online (Sandbox Code Playgroud)@property(nonatomic, retain) UIView *titleView
所以我认为你可以试试这个:
[titleView setHidden:YES];
Run Code Online (Sandbox Code Playgroud)
另一个保留后退按钮的选项(如此处回答:https : //stackoverflow.com/a/23113326/1156575):
[self.navigationController.navigationBar setTitleTextAttributes:@{
NSForegroundColorAttributeName : [UIColor clearColor]
}];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7728 次 |
| 最近记录: |