MFMessageComposeViewController未正确显示 [英] MFMessageComposeViewController not properly displayed

查看:134
本文介绍了MFMessageComposeViewController未正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MFMessageComposeViewController来显示SMS发送界面。

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

我的应用程序使用全屏,状态栏被plist文件中的设置隐藏(状态栏最初隐藏= YES)。

My app uses full screen, the status bar is hidden by settings in plist file (Status bar is initially hidden = YES).

当我显示消息编写器时:

When I show the message composer with:

+(void)composeSMS:(id)sender
{
    if (![MFMessageComposeViewController canSendText]) return;

    MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];

    controller.wantsFullScreenLayout = YES;

    controller.messageComposeDelegate = sender;
    [controller setBody:@"He descubierto un App estupenda! . "];
    [controller setModalPresentationStyle:UIModalTransitionStyleFlipHorizontal];
    if (controller) [sender presentModalViewController:controller animated:YES];
    [controller release];

}

问题是当显示作曲家时导航栏是在顶部y = 0,但在此栏和视图的其余出口之间显示与状态栏大小相同的空白空间。状态栏显示在此屏幕中(第二期),但与作曲家视图的导航栏重叠。

The problem is when the composer is displayed the navigation bar is on the top y = 0, but between this bar and the rest of outlets of the view appears an empty space of the same size as the status bar. The status bar is showed in this screen (second issue) but is overlapping the navigation bar of the composer view.

在其他状态栏未隐藏的项目中,奇迹般有效。但这是第一个没有状态栏使用它的项目,这种情况正在发生。

In other projects where the status bar is not hidden, this works like a charm. But this is the first project where it is used without status bar and this is happening.

任何人都知道如何修复它?

Anyone knows how to fix it?

谢谢。

推荐答案

模态显示消息控制器后隐藏状态栏。这样的事情:

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

这篇关于MFMessageComposeViewController未正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆