簡體   English   中英

從人像視圖控制器呈現模態風景視圖控制器

[英]Present a modal landscape View Controller from a portrait View Controller

我有一個僅提供肖像的VC,它提供了僅提供風景的VC。 我正在努力查看如何使它工作。 在呈現模態VC之后,我可以調用一個動畫來旋轉VC,但運氣不錯,但看起來有些晦澀。

我堅持使用iOS 4.3,因此沒有故事板。

我想要的是...

[landscapeVC setOrentation:UIDeviceOrentaionLanscape];
[portraitVC presentModalViewController:landscapeVC Animated:YES];

謝謝你的幫助

在portraitVC的viewDidLoad方法和shouldautorotate方法中使用此方法:

 [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
 [[self view] setBounds:CGRectMake(0, 0, 480, 320)];
 [[self view] setCenter:CGPointMake(160, 240)];
 [[self view] setTransform:CGAffineTransformMakeRotation(M_PI / 2)];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM