将我的项目升级到iOS7后,我的视图显示在状态栏下。后来我通过将以下代码添加到DashBoardViewController(根导航控制器)viewdidAppear
来修复此问题float systemVersion=[[[UIDevice currentDevice] systemVersion] floatValue];
if(systemVersion>=7.0f)
{
CGRect tmpFrame = self.navigationController.view.frame;
tmpFrame.origin.y = 20;
self.navigationController.view.frame = tmpFrame;
}
但是在我的SettingsViewController中,当我提出模态视图来显示sms作曲家时,再次在状态栏下完成或取消该视图后。但是当回到DashBoardViewController视图恢复正常时。我不知道该怎么办。我希望我能解释一下这个问题。我的代码和屏幕截图如下。
- >截图:
- (IBAction)act_shareSMS:(id)sender {
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
NSString* message = @"adasdasd";
controller.body =message;
controller.messageComposeDelegate = self;
if([NavigationManager sharedManager].contentNavigation)
[[NavigationManager sharedManager].contentNavigation presentModalViewController:controller animated:YES];
}
- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result {
[[NavigationManager sharedManager].contentNavigation dismissModalViewControllerAnimated:YES];
if (result == MessageComposeResultCancelled) {
NSLog(@"Message cancelled");
}
else if (result == MessageComposeResultSent) {
NSLog(@"Message sent");
}
}
答案 0 :(得分:0)
此更改是对iOS 7的预期更改,这可以帮助您处理它http://www.doubleencore.com/2013/09/developers-guide-to-the-ios-7-status-bar/
尝试在viewcontrollers子视图上使用iOS 6/7 delta来自动修复此问题
将delta Y设置为20,它会自动将其向下移动
答案 1 :(得分:0)