我在UIInterfaceOrientationMaskAll
方法中设置了supportedInterfaceOrientations
。
当我呈现UIModalViewController
时,无论屏幕旋转如何,我总是得到748 x 1024的视图尺寸。如果我旋转屏幕,尺寸不会更新,并且在纵向和横向模式下相同:748 x 1024.
这是提供模态视图的代码:
MyModalViewController *myModal = [[MyModalViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:myModal animated:YES];
MyModalViewController扩展了另一个MyCUSTOMViewController,它是UIViewController
的子类:
@interface MyModalViewController : MyCUSTOMViewController
@interface MyCUSTOMViewController : UIViewController
我做错了什么?
答案 0 :(得分:1)
根据我的阅读,有几件事需要考虑:
-(NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
中覆盖UIApplicationDelegate
,然后返回 UIInterfaceOrientationMaskAll
:- (BOOL)shouldAutorotate { return YES; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; }