导航栏在横向模式中向上移动 - iOS

时间:2017-05-26 07:05:47

标签: ios landscape-portrait

肖像

enter image description here

风景

enter image description here

iPhone横向模式上的导航栏向上移动高度尺寸的一半,而在纵向模式下,它看起来很好。

请帮忙。

1 个答案:

答案 0 :(得分:0)

viewDidload中,您应该设置退出按钮和标题,例如

UIBarButtonItem *barButton = [[UIBarButtonItem alloc]initWithTitle:@"Log out" style:UIBarButtonItemStylePlain target:nil action:nil];

self.navigationItem.rightBarButtonItem = barButton;

self.title = @"PROFILE";

它在模式肖像和风景中都能正常工作!

输出:

肖像

enter image description here

风景

enter image description here

相关问题