簡體   English   中英

Ipad Simulator無法自動旋轉

[英]Ipad Simulator not auto rotating

我有一個iPhone應用程序,正在使用shouldAutorotateToInterfaceOrientation確定何時自動旋轉。 在iphone上,我指定UIInterfaceOrientationPortrait是唯一允許的方向。 在iPad上,我只返回YES(即全部允許),如下所示:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) //also tried using [[UIDevice currentDevice] userInterfaceIdiom] to no avail
  return YES; //doesn't get here
 return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

這在選項卡欄的每個視圖控制器中。 當我通過NSLog() [[UIDevice currentDevice] userInterfaceIdiom] ,它返回0(或UIUserInterfaceIdiomPhone )。

iPad模擬器是否總是返回UIUserInterfaceIdiomPhone

暫無
暫無

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

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