[英]changing view controller when the device orientation changes
Im making an ios app in xcode 4 and I need a way of changing what is displayed on the screen when the device orientation changes. 我在xcode 4中制作了一个ios应用程序,我需要一种方法来更改设备方向更改时屏幕上显示的内容。
does anyone know how to do this? 有谁知道如何做到这一点?
thanks. 谢谢。
probably you need to check first how to detect if the device orientation changes see here: how to detect orientation change 可能您需要首先检查如何检测设备方向是否发生变化,请参见此处: 如何检测方向变化
then on the example on the link, you should know ho to change the view which is displayed on the screen. 然后在链接上的示例中,您应该知道如何更改屏幕上显示的视图。 You can do it by using methods such as addSubview, presentModalViewController, pushViewController(for NavigationController) eg:
您可以使用诸如addSubview,presentModalViewController,pushViewController(用于NavigationController)之类的方法来实现,例如:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.