2016-09-20 17 views
0

,我覺得是不同的,當我設置iOS10 UINavigationButton位置不同形式iOS9

UIBarButtonItem *cancelViewButton = [[UIBarButtonItem alloc] initWithTitle:@"cancel" style:UIBarButtonItemStylePlain target:self action:@selector(popCurrentViewController)]; 
self.navigationItem.rightBarButtonItem = cancelViewButton; 

在iOS上10

enter image description here

在iOS 9

enter image description here

回答

0

我需要縮小導航題目查看

#define iOS10Later ([UIDevice currentDevice].systemVersion.floatValue >= 10.f) 

if(iOS10Later) {navigation.titleView = [[SearchBarView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH - 120, 30)];}