Objective c 将视图从横向转换为纵向?

Objective c 将视图从横向转换为纵向?,objective-c,ios,cocoa-touch,uiinterfaceorientation,Objective C,Ios,Cocoa Touch,Uiinterfaceorientation,我已经为横向模式开发了应用程序,现在客户要求在横向和纵向模式下构建 如何将横向视图转换为纵向视图 现在,我将此代码用于景观视图: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrien

我已经为横向模式开发了应用程序,现在客户要求在横向和纵向模式下构建

如何将横向视图转换为纵向视图

现在,我将此代码用于景观视图:

 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{

 return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft) || (interfaceOrientation == UIInterfaceOrientationLandscapeRight);

 }
请帮帮我


提前感谢:)

学习如何使用自动调整大小的遮罩。它们很简单,但在大多数情况下都非常强大。

简单,要支持所有方向,只需返回
YES
shouldAutorotatePointerFaceOrientation

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
    return YES;
    //Or to support all but portrait upside down
    return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;
}

恩波斯特·维奈德是对的。您只需返回yes shouldAutorotateToInterfaceOrientation。这样,您就可以支持所有方向。看看通过XIB调整属性的大小。这也会使你的工作变得容易