iPhone 屏幕旋转:我可以强制旋转 90 度吗?

发布于 2024-08-01 16:43:09 字数 84 浏览 4 评论 0原文

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

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

发布评论

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

评论(2

听风吹 2024-08-08 16:43:09

我建议手动监控加速度计以了解您想要旋转的角度,然后强制您的视图控制器旋转到该方向。

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.

一生独一 2024-08-08 16:43:09

我假设您无法使用内置的自动旋转回调来满足您的要求,但必须构建自己的视图旋转或由加速度计读数控制的备用视图。

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.

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