![](/img/trans.png)
[英]Different orientation behavior of modalviewcontroller between iphone and ipad
[英]ModalViewController dimensions on orientation change
我已經在supportedInterfaceOrientations
方法中設置了UIInterfaceOrientationMaskAll
。 當我呈現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
我究竟做錯了什么?
根據我的閱讀,有幾件事情需要考慮:
-(NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
的應用程序的內UIApplicationDelegate
,並返回UIInterfaceOrientationMaskAll
: - (BOOL)shouldAutorotate { return YES; } - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.