在我的 iphone 应用程序中,我通过以下方法返回了是,它可以工作并且屏幕正在旋转,但是当它处于横向模式时,内容不适合屏幕
以下是我使用的代码
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
以下是我的输出
旋转时如何使屏幕内容适合屏幕尺寸,任何人都可以帮助我,谢谢,
在我的 iphone 应用程序中,我通过以下方法返回了是,它可以工作并且屏幕正在旋转,但是当它处于横向模式时,内容不适合屏幕
以下是我使用的代码
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
以下是我的输出
旋转时如何使屏幕内容适合屏幕尺寸,任何人都可以帮助我,谢谢,
reset the views frame
当设备即将旋转时,您应该这样做。这通常应该在willRotateToInterfaceOrientation
方法中完成。
您也可以简单地使用autoResizingMask
which 将在其 superView 框架更改时自动调整视图大小。
// Add this line in loadView method
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight;
阅读本教程:
http://www.shinstudio.com/blog/programming/rotating-view-in-iphone-app/
实施willRotateToInterfaceOrientation
将是解决方案