且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在iPhone SDK中删除应用程序纵向方向的功能

更新时间:2023-10-16 15:30:16

在视图控制器中,有一个委托方法:

In your view controller, there's a delegate method for this:

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