MFMessageComposeViewController not properly displayed

前端 未结 2 920
野性不改
野性不改 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: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

提交回复
热议问题