iOS 上方向改变时的非旋转背景图像
我正在开发一个 iPhone 应用程序,它允许纵向和横向方向。但是,我在 UIImageView 中有一个背景图像,当方向改变时不应旋转该背景图像。我四处搜寻并尝试了一些选项,但没有找到令人满意的解决方案。我尝试在 willAnimateRotationToInterfaceOrientation: 中使用变换,但它使图像在旋转过程中移动,并且看起来不太好。我希望它保持静止。
任何帮助表示赞赏。
I'm developing an iphone app and it allows for both portrait and landscape orientation. However, I have a background image, in an UIImageView, which should not be rotated when the orientation changes. I've searched around and experimented with some options, but have not found a satisfactory solution. I tried using transforms in willAnimateRotationToInterfaceOrientation: but it makes the image move during rotation, and doesn't look good. I would like it to remain stationary.
Any help appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许尝试这个:
因为您的 appDelegate.window 不关心当前的设备方向,所以它可能是一个解决方案。我只是尝试在方法中的appDel.window中添加一个UIImageView
,正如预期的那样,它不会与上面的uiviewcontroller.view一起旋转
当然你也可以尝试addSubview:
Maybe try this:
as your appDelegate.window doesn't care about the current device orientation it might work out as a solution. I just tried adding a UIImageView to the appDel.window in the
method, and as expected, it does not rotate with the above uiviewcontroller.view
Of course you could also try addSubview: