iPhone 状态栏方向与 opengl
我只有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看绑定的属性。方向改变时框架自动改变,绑定属性号。
Look at the bound property. Frame change automatically when orientation change, bound property no.