一个视图控制器的肖像,其他景观

问题描述:

我有初始视图控制器是肖像,我希望下一个视图控制器只是风景。用户不能转动iPhone/iPad来改变旋转。有人可以帮助我吗?一个视图控制器的肖像,其他景观

任何帮助表示赞赏。

我想你想要的是:shouldAutoRotateToInterfaceOrientation方法UIViewController类。如果UIView支持方向,则此函数返回YES。如果您只有return YESlandscape orientation,那么iPhone将自动进入该方向。

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationLandscape); 
} 

好运!

+0

您总是欢迎您! – Bhavin

也许你正在寻找UIViewController shouldAutorotateToInterfaceOrientation或其他一些方向相关的成员。