在我的應用程序中,我試圖強制視圖控制器僅肖像。我使用下面的代碼,但沒有真正發生。我仍然能夠在縱向上看到風景畫面?強制視圖控制器只肖像
我在我的項目設置中啓用了橫向(左/右),縱向。
我做錯了什麼?
ViewController.m
- (BOOL)shouldAutorotate
{
return NO;
}
- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
嵌入到另一個控制器視圖控制器,比如導航控制器或標籤欄控制器? – 2014-10-05 17:39:36
是的,它在導航控制器:) – directory 2014-10-05 18:45:23