强制横屏在ios7设备下显示bug

工作中需要用到某一页面强制横屏显示,但是在ios8以上显示正常横屏,而在ios7上显示半屏(并没有横屏)的bug
并提示警告: Presenting view controllers on detached view controllers is discouraged

发现原因:我present视图的位置是push进去的二级页面,使用[self presen...];应该使用rootViewController   present
so:使用    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
     [appDelegate.window.rootViewController presentViewController:sleepChart animated:YES completion:nil];进行present不光
      解决了警告,而且解决了强制横屏在ios7下显示bug的问题


posted @ 2015-08-27 15:38  笑小墨  阅读(172)  评论(0编辑  收藏  举报