iOS-解决title不居中问题

2016-08-18  本文已影响0人  zzzzzzzzzl

如果标题过长,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];

}

原文链接

上一篇下一篇

猜你喜欢

热点阅读