美文网首页
导航栏设置

导航栏设置

作者: 然亦伞 | 来源:发表于2017-11-07 17:10 被阅读12次

//去掉导航条

self.navigationController.navigationBar.hidden = YES;

//去掉push页面的默认左边返回按钮

//要在push之前设置。

- (void)onClickSearch{

MerchantSearchTableViewController *searchTVC = [[MerchantSearchTableViewController alloc]init];

//去掉MerchantSearchTableViewController页的返回按钮

self.navigationController.navigationItem.hidesBackButton = YES;

[self.navigationController pushViewController:searchTVC animated:YES];

}

//设置导航栏右边按钮

UIButton* barButtonItemSearch = [UIButton buttonWithType:UIButtonTypeCustom];

[barButtonItemSearch setTitle:AppLocalizedString(@"Cancel") forState:UIControlStateNormal];

[barButtonItemSearch addTarget:self action:@selector(onClickCancel) forControlEvents: UIControlEventTouchUpInside];

barButtonItemSearch.frame = CGRectMake(screenWith - 32, 0, 22, 22);

UIBarButtonItem *SearchBarButton = [[UIBarButtonItem alloc] initWithCustomView:barButtonItemSearch];

self.navigationItem.rightBarButtonItem = SearchBarButton;

相关文章

网友评论

      本文标题:导航栏设置

      本文链接:https://www.haomeiwen.com/subject/dyqthttx.html