你好,我想在我的應用程序中支持肖像,主頁按鈕,我該怎麼做?支持方向IOS
我去我的項目設置,檢查這兩個
,我在下面添加
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
我也試過
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown);
}
的代碼,但沒有一個似乎工作
任何幫助
您確定將代碼放在正確的控制器中嗎?你是否嘗試過只是返回YES來查看它是否是邏輯問題(即使它看起來不錯)? – 2012-03-08 22:14:26
一切都是正確的,但是...你把那些代碼放在哪裏?在哪個控制器上? – fbernardo 2012-03-08 22:16:01
是的我有一個視圖控制器,它在那裏我試過也是,這也不工作要麼 – 2012-03-08 22:16:26