1.自定义返回按钮
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:@"返回"
style:UIBarButtonItemStyleBordered target:nil action:nil];
[self.moreItem setBackgroundImage:[UIImage new] forState:UIControlStateNormal barMetrics:UIBarMetricsDefault];
[self.navigationItem setBackBarButtonItem:backItem];
若想使返回按钮不可用
self.navigationItem.leftBarButtonItem = nil;
2.设置标题图片
self.navigationItem.titleView
= [[UIImageViewalloc]
initWithImage: [[UIImageimageNamed:@"barLogo.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];
3.设置rightBarButtonItem
self.navigationItem.rightBarButtonItem=[[UIBarButtonItemalloc]
initWithImage:[UIImageimageNamed:@"MoreImage.png"]style:UIBarButtonItemStylePlaintarget:selfaction:@selector(rightItemPress)];
若想使rightBarButtonItem不可用
self.navigationItem.rightBarButtonItem
= nil;
版权声明:本文为博主原创文章,未经博主允许不得转载。