2011-03-14 97 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; 


} 
相关问题