iPhone 屏幕旋转:我可以强制旋转 90 度吗?
我的 iPhone 应用程序在模拟器中旋转得很好,但当我将其部署在物理设备上时,旋转非常非常敏感。 如何解决此问题并确保屏幕仅在形成 90 度角时旋转?
My iPhone app rotates fine in the simulator but when I deploy it on a physical device, rotating is very very sensitive. How can I fix this issue and make sure the screen rotates only when a 90 degree angle is made?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议手动监控加速度计以了解您想要旋转的角度,然后强制您的视图控制器旋转到该方向。
I would recommend manually monitoring the accelerometer for the angles you want to rotate at, then forcing your view controller to rotate to that orientation.
我假设您无法使用内置的自动旋转回调来满足您的要求,但必须构建自己的视图旋转或由加速度计读数控制的备用视图。
I assume you couldn't use the built-in autorotate callbacks for your requirements but have to build your own view rotation or alternate views that are controlled by readings from the accelerometer.