自动旋转问题

发布于 2024-11-15 23:11:37 字数 87 浏览 6 评论 0原文

我想在我的应用程序中自动旋转,但有一个问题,纵向模式下的背景与横向模式下的背景不同。 有谁可以给​​我一个简短的例子来解决这个问题吗?

提前致谢

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鲜血染红嫁衣 2024-11-22 23:11:37

实现该方法

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation

在包含背景的 ViewController 中 。查询此ViewController上的interfaceOrientation属性以找出当前方向是什么,并根据该值设置背景(其类型为UIInterfaceOrientation)。

Implement the method

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文