iPhone 状态栏方向与 opengl

发布于 2024-08-29 00:50:04 字数 406 浏览 1 评论 0原文

我只有 opengl 视图,使用投影矩阵以纵向和横向模式显示(视图的变换始终是同一的)。我需要以正确的方向显示状态栏。我通过在 UIApplication 中设置状态栏方向属性并更改 opengl 视图的框架来做到这一点,这样视图就不会进入状态栏下方。

当我从横向更改为纵向(横向是初始状态)时,视图的框架设置为(0,20,320,460)并保持这样。然而视图似乎是通过(-10,-10)平移的。

看来我确实改变了视图的大小,但无法移动它。奇怪的事情是:

  • 最初视图是全屏的,我将其更改为 (0, 0, 300, 480) (带状态栏的横向),然后它就可以工作了,当我尝试将其更改为第二次(带状态栏的纵向)

  • 视图的框架属性显示视图放置正确

有关问题的任何想法?

I have opengl only view that displays in portrait and landscape mode using projection matrix (view's transformation is identity all the time). I need to show status bar with proper orientation. I do this by setting status bar orientation property in UIApplication and changing frame of opengl view so the view won't go under status bar.

When I change from landscape to portrait (landscape is the initial state) view's frame is set to (0, 20, 320, 460) and stays like this. However view appears to be translated by (-10, -10).

It seems that I did change the size of view but couldn't move it. Weird things are:

  • initialy view is full screen, I change it to (0, 0, 300, 480) (landscape with status bar) and it works then, it doesn't work when I try to chenge it for the second time (portrait with status bar)

  • frame property of the view shows that view is placed correctly

Any thoughts on what can by the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

﹎☆浅夏丿初晴 2024-09-05 00:50:04

查看绑定的属性。方向改变时框架自动改变,绑定属性号。

Look at the bound property. Frame change automatically when orientation change, bound property no.

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