Apple的控制器在iOS7中无法正常显示

时间:2013-10-13 15:32:59

标签: ios ios7 uiimagepickercontroller mfmessagecomposeview

在我的iOS应用程序中,我提供了标准控制器MFMessageComposeViewController和UIImagePickerController。

但他们都带着奇怪的导航栏。

enter image description here

enter image description here

enter image description here

我该如何解决这个问题?

用于呈现控制器的

UPD 代码

的UIImagePickerController:

UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init];
    cameraUI.sourceType = sourceType;
    cameraUI.allowsEditing = YES;
    cameraUI.delegate = self;
    [self presentViewController:cameraUI animated:YES completion:nil];

MFMessageComposeViewController:

MFMessageComposeViewController *messageViewController = [[MFMessageComposeViewController alloc] init];
    if([MFMessageComposeViewController canSendText]) {
        messageViewController.view.backgroundColor = [UIColor whiteColor];
        messageViewController.messageComposeDelegate = self;
        recipient= [NSStringMask maskString:recipient withPattern:@"\\+(\\d{1}) \\((\\d{3})\\) (\\d{3})-(\\d{2})-(\\d{2})"];
        messageViewController.recipients = @[recipient];
        messageViewController.body = body;
        [self presentViewController:messageViewController animated:YES completion:nil];
    }

2 个答案:

答案 0 :(得分:2)

在iOS 7中,状态栏和导航默认为半透明。要使视图像iOS 6中那样“正常”,您需要将其添加到您正在呈现的控制器中。

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

如果您想了解有关视图更改的更多信息。看看这篇文章。我发现这是一个很好的快速概述,它改变了。

http://www.brianjcoleman.com/ios7-weve-got-a-problem/

答案 1 :(得分:1)

this question。我使用了第二个答案,但我怀疑第一个答案对我也有用。