uinvigationcontroller 问题的 iOS 7 导航栏

标签 ios ios7

我附上了 UI 在不同 iOS 版本上的外观。

下面是我的代码:

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:contactsViewController];
[self.viewController presentModalViewController:navController animated:YES];

iOS 6

enter image description here

iOS 7

enter image description here

第一个问题是 iOS 6 中的状态栏我没有状态栏。第二个问题是 overdraw 两个 View 。如何解决?

最佳答案

您可能希望使用可调整大小的图像:

[image resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0) resizingMode:UIImageResizingModeStretch];

或者,按照AliSoftware的建议,将扩展布局边缘设置为UIRectEdgeNone(务必检查是否支持edgesForExtendedLayout(您的应用将如果分配此属性在 iOS 6.x 设备上运行时会崩溃:

if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
    self.edgesForExtendedLayout = UIRectEdgeNone;
}

关于uinvigationcontroller 问题的 iOS 7 导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18813805/

相关文章:

iOS 8.3 : UIActivityViewController shows extraneous row

iphone - 在 iOS 的邮件编辑器中设置收件人字段的问题

ios - 如何在 Swift 中将时间/日期数组从最旧到最新排序?

ios - AVSpeechSynthesizer 支持哪些语言?

ios - 带有 NSURL 到音频文件的 UIActivityViewController 只显示空投

ios - 如何在加载数据后安全地解包 TableView 单元格

ios - 图片搜索接口(interface)

ios - 室内图集 : Get checkpoint list created

ios - Root View Controller 偶尔丢失

ios - 如何切换音频输出以通过扬声器播放?