[英]Incorrect ViewController Orientation After Segue IOS7
我有2個ViewControllers
,主要的一個應該是shouldAutoRotate-NO
,第二個應該是shouldAutoRotate-YES
。 我正在向第二個ViewController
提供功能presentViewController:
並使用UIModalPresentationCurrentContext
因為我在第二個ViewController
上有一個透明的Background來仍然在背面查看第一個ViewController
。
問題是,當我在“ Landscape”中的第一個ViewController
中時(由於shouldAutoRote-NO
而出現在Portrait中),並且我呈現了第二個ViewController
,第二個ViewController
出現在風景中,但是如果我將iPhone旋轉回Portrait我不會旋轉,除非我將手機旋轉回橫向,這使定向恢復正常。
狀態欄的行為始終是正確的,問題在於ViewControllers
。
有什么建議么?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskAll;
}
您只需在當前的視圖控制器中提供所需的方向類型即可。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.