MFMessageComposeViewController not properly displayed

前端 未结 2 918
野性不改
野性不改 2021-01-21 19:08

I\'m using MFMessageComposeViewController in order to show the SMS send interface.

My app uses full screen, the status bar is hidden by settings in plist file (Status b

相关标签:
2条回答
  • 2021-01-21 19:22

    Hide the status bar after you modal presented the message controller. Something like this:

    controller.wantsFullScreenLayout = NO;
    [self presentModalViewController:controller animated:YES];
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
    
    0 讨论(0)
  • 2021-01-21 19:23

    The way I dealt with using iMessage inside an app was to take control of the status bar myself. For example:

    [[UIApplication sharedApplication] setStatusBarHidden:FALSE withAnimation:UIStatusBarAnimationSlide];
    MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
    controller.messageComposeDelegate = self;
    [self presentModalViewController:controller animated:TRUE];
    [controller release];
    

    Then when finished either through a send or a cancel:

    - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
          [self dismissModalViewControllerAnimated:TRUE];
          [[UIApplication sharedApplication] setStatusBarHidden:TRUE withAnimation:UIStatusBarAnimationSlide];
          self.view.frame = CGRectMake(0.0, 0.0, [LayoutHelper width], [LayoutHelper height]);
          self.view.center = CGPointMake([LayoutHelper xCenterPoint], [LayoutHelper yCenterPoint]-20);
    }
    

    This seems to display the iMessage and then return to the app without any empty space appearing from the status bar being added or removed.

    This is my first post so i hope this helps somehow.

    cheers

    0 讨论(0)
提交回复
热议问题