2011-03-04 115 views
3

我已經開發了我的縱向方向項目,現在我想在橫向上設置我的項目方向。我已經將所有xib文件的方向屬性設置爲橫向,並且在.plist中也將所有支持的界面方向的項目設置爲橫向,但是當我運行我的項目時,一個視圖仍然以縱向取向...在此視圖中, pdf文件。將我的項目從縱向轉換爲橫向的問題

在此先感謝!

+0

嘗試設置的,該框架元素的方向變化 –

+0

你的意思是所有的意見都應該改爲蘭斯卡提供任何可能的取向都是pe取向。 – SNR

回答

2

做你把下面的方法在您的視圖控制器

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return YES; 
} 
+0

非常感謝Kshitiz!實際上這個方法被評論了。 –

+0

我想可能是你忘記了這個功能,哈哈,所以我回答說 –

1

如果橫向使用此代碼

(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight); 
} 

如果肖像使用此代碼

(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return (interfaceOrientation==UIInterfaceOrientationPortrait || interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown); 
} 
相關問題