Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios4 MFMailComposeViewController和状态栏问题_Ios4 - Fatal编程技术网

Ios4 MFMailComposeViewController和状态栏问题

Ios4 MFMailComposeViewController和状态栏问题,ios4,Ios4,我有一个UIViewController,它的视图手动添加到另一个视图中 当我使用以下方式显示MFMailComposeViewController时: [self presentModalViewController:mailController animated:YES]; 然后删除它,我的视图显示邮件生成器,它的Y原点更改为20。(状态栏高度) 我找不到原因。你有什么想法吗 谢谢。我自己也遇到了这个问题。不确定为什么会发生这种情况,但对我有效的是将以下内容放在显示模态视图的控制器的Vie

我有一个
UIViewController
,它的视图手动添加到另一个视图中

当我使用以下方式显示MFMailComposeViewController时:

[self presentModalViewController:mailController animated:YES];
然后删除它,我的视图显示邮件生成器,它的Y原点更改为20。(状态栏高度)

我找不到原因。你有什么想法吗


谢谢。

我自己也遇到了这个问题。不确定为什么会发生这种情况,但对我有效的是将以下内容放在显示模态视图的控制器的ViewWillAspect方法中:

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
self.wantsFullScreenLayout = YES;

我自己也遇到了这个问题。不确定为什么会发生这种情况,但对我有效的是将以下内容放在显示模态视图的控制器的ViewWillAspect方法中:

[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
self.wantsFullScreenLayout = YES;

对我有用的是

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];

就在展示视图之后。

对我有效的是

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationNone];
显示视图后立即添加。

尝试添加:

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

这将使您的UI保持在状态栏下

除非您想完全隐藏状态栏,否则您应该使用crinkle的答案

尝试添加:

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

这将使您的UI保持在状态栏下


除非你想完全隐藏状态栏,否则你应该使用crinkle的答案

谢谢!你刚刚把我从大量的黑客攻击中救了出来。FWIW,仅“WantFullScreenLayout”似乎就为我做到了。谢谢!你刚刚把我从大量的黑客攻击中救了出来。FWIW,仅“WantFullScreenLayout”一项似乎就帮了我的忙。@thierrb:我也面临着同样的问题。你有什么解决办法吗?@thierrb:我也面临同样的问题。你有什么解决办法吗?