Eugene Trapeznikov
Eugene Trapeznikov

Reputation: 3240

Apple's controllers not presenting properly in iOS7

In my iOS app i present standerd controllers MFMessageComposeViewController and UIImagePickerController.

But they both presenting with strange navigation bar.

enter image description here

enter image description here

enter image description here

How can i fix this problem?

UPD code for presenting controllers

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];
    }

Upvotes: 0

Views: 732

Answers (2)

T.J.
T.J.

Reputation: 3960

See this question. I used the second answer, though I suspect the first would work for me also.

Upvotes: 1

mashdup
mashdup

Reputation: 875

In iOS 7, the status bar and the navigation is translucent by default. To make the view act 'normal' like in iOS 6. you need to add this to the controller you are presenting.

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

If you want to read up more about changes in views. Check out this post. I find it a nice quick overview whats changed.

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

Upvotes: 2

Related Questions