我已使用以下 IO6 及以下代码强制旋转:
-(void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
UIApplication* application = [UIApplication sharedApplication];
if (application.statusBarOrientation != UIInterfaceOrientationPortrait)
{
UIViewController *c = [[UIViewController alloc]init];
[c.view setBackgroundColor:[UIColor redColor]];
[self.navigationController presentViewController:c animated:NO completion:^{
[self.navigationController dismissViewControllerAnimated:NO completion:^{
}];
}];
}
}
但它在 IOS7 上无法正常工作,它旋转视图控制器但再次在屏幕上设置空白视图......
你能帮我在IOS 7中解决这个问题吗...