2011-03-14 134 views
0

中的橫向視圖programmaticaly我試圖在橫向視圖中開發屏幕方向。如何在橫向視圖中設置屏幕方向,如iphone

這裏在我的應用程序中我完成了縱向視圖,但我試圖查看像一個橫向視圖也。

可以任何一個plz幫助我的問題。屏幕方向在橫向視圖programmaticaly在iphone

三江源提前

回答

3

試試這個:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
return YES 
} 
0
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
return YES 
} 

確保您已設置要顯示的視圖自動調整大小屬性。

1
- (void) applicationDidFinishLaunching: (UIApplication*) application 
{ 
    CGRect screenBounds = [[UIScreen mainScreen] bounds]; 

    m_window = [[UIWindow alloc] initWithFrame: screenBounds]; 
    viewController = [[MYViewController alloc] init]; 
    [m_window addSubview:viewController.view]; 
    [m_window makeKeyAndVisible]; 
} 


- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { 
    // Return YES for supported orientations 
    return ((interfaceOrientation == UIInterfaceOrientationLandscapeRight)); 
} 
在所有視圖控制器

設置Info.plist文件鍵值

UIInterfaceOrientation UIInterfaceOrientationLandscapeRight 
+0

請投如果u找到正確的 – Hanuman 2011-03-14 10:10:37

1
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 

    return YES; 


} 
相關問題