自动旋转问题
我想在我的应用程序中自动旋转,但有一个问题,纵向模式下的背景与横向模式下的背景不同。 有谁可以给我一个简短的例子来解决这个问题吗?
提前致谢
I want autorotate in my application but there is a problem, the background in portrait mode is not the same as in landscape mode.
Is there anybody who can give me a short example how to solve this problem, please?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实现该方法
在包含背景的 ViewController 中 。查询此ViewController上的interfaceOrientation属性以找出当前方向是什么,并根据该值设置背景(其类型为UIInterfaceOrientation)。
Implement the method
in the ViewController that contains the background. Query the interfaceOrientation property on this ViewController to find out what is the current orientation and set the background according to the value (which is of type UIInterfaceOrientation).