2010-08-09 66 views

回答

0

试试这个..

[[UIDevice currentDevice] performSelector:@selector(setOrientation:) withObject:(id)UIInterfaceOrientationLandscapeRight]; 
0

确保在您的视图控制器-shouldAutorotateToInterfaceOrientation:返回YES

0

请注意,setOrientation是根据UIDevice(该属性为只读)的文档的私有API。如果您使用它,您的应用程序将在App Store审查期间被拒绝。

取而代之的是强制定位,您应该在该视图的层次结构的所有视图控制器中覆盖shouldAutorotateToInterfaceOrientation,并且仅返回YES仅适用于您要支持的定向。