如果标题过长,push下个页面,会导致这个页面title不居中!
NSArray*viewControllerArray = [self.navigationControllerviewControllers];
longpreviousViewControllerIndex = [viewControllerArrayindexOfObject:self] -1;
UIViewController*previous;
if(previousViewControllerIndex >=0) {
previous = [viewControllerArrayobjectAtIndex:previousViewControllerIndex];
previous.navigationItem.backBarButtonItem= [[UIBarButtonItemalloc]
initWithTitle:@" "
style:UIBarButtonItemStylePlain
target:self
action:nil];
}
网友评论