关于 iPhone 方向和固件:始终强制方向

发布于 2024-09-15 13:55:18 字数 776 浏览 10 评论 0原文

最近,我收到 QA 人员的短信,说开发的应用程序在 iPhone 3 上的方向不正确,但在 iOS 4 上可以正确显示。他们说在 iOS 3 上,该应用程序的方向是纵向视图,这使得该应用程序下面留下灰色空间。然而,他们声称在 iOS 4 上,方向是正确的。

我在我的 3GS 上测试了他们的说法(使用 iOS4)。我的应用程序始终在我的 iPhone 上正确呈现。这很奇怪,因为:

  1. 该应用程序是在iOS4发布之前开发的,并且旋转的代码保持不变。这意味着过去的 iOS3 轮换工作正常。
  2. 我使用基础 3.2.3 版本运行我的应用程序,但无法生成 QA 所声称的内容。这适用于模拟器(在 iOS 3.2.3 和 4 上测试)和实际设备。 (使用 iOS4)
  3. 旋转从 iOS3 开始就可以工作,并且它也可以在我的 iPhone 上的 iOS4 上工作。

这是一个非常奇怪的情况,并且无法重现 QA 声称的错误。那么在这种情况下,我需要一些建议,你能列出所有的定向方法吗?当然,这是矫枉过正,但无法重现他们的主张,我真的需要一种方法来强制应用程序始终在横向视图上强制方向。

所以我记下了以下内容:

  • 编辑 plist 以将初始界面方向设置为横向。
  • 应用 setStatusBarOrientation 方法。可以在 ViewController 的 viewWillAppear 方法中执行此操作。
  • 在方法:shouldAutoRotateToInterfaceOrientation 中,仅设置所需的方向。

非常感谢任何帮助。

Lately, I have received a text from the QA folks saying that the developed app's orientation is incorrect on iPhone 3, while it can display correctly on iOS 4. They say on iOS 3, the app's orientation is on portrait view, which makes the app leaving gray space below. However, they claimed that on iOS 4, the orientation is correct.

I test their claims on my 3GS (using iOS4). My app is always rendered correctly on my iPhone. It's pretty strange, because:

  1. The app has been developed before the release of iOS4, and the codes for rotation is left intact. This implies that the rotation works correctly for iOS3 in the past.
  2. I run my app using base 3.2.3 version, and I could not produce what the QA is claiming. This applies to both the simulator (tested on both iOS 3.2.3 and 4) and the actual device. (which uses iOS4)
  3. The rotation works since iOS3, and it also works on iOS4 on my iPhone.

This is a very strange case, and without being able to reproduce the bug the QA is claiming. So in this case, I need some advice, could you possibly list out all of the methods for the orientation? This is overkill, of course, but without able to reproduce their claims, I really need a way to force the app to always force orientation on a landscape view.

So I've jotted the following:

  • edit the plist for initial interface orientation for landscape orientation.
  • application setStatusBarOrientation method. Possibly do this in the viewWillAppear method of the ViewController.
  • in the method: shouldAutoRotateToInterfaceOrientation, set the desired orientation only.

Any help is really appreciated.

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

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

发布评论

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

评论(2

蓝色星空 2024-09-22 13:55:18

好吧,在亲自尝试之后,我想我现在知道到底发生了什么。方向已经始终是横向的,我所需要的只是手动翻译旧版 iOS 的视图。我认为 iOS4 似乎足够聪明来处理这个问题?

Okay, I think I now know what's really going on, after trying things on my own. The orientation is already always on landscape, and all I need is manual translation of the view for older iOS. iOS4 seems to be smart enough to handle this, I presume?

始于初秋 2024-09-22 13:55:18

如果您的轮换代码设置正确,您应该需要有任何版本特定的情况。如果视图没有针对您想要的方向对 shouldAutoRotateToInterfaceOrientation: 回复 YES,您将获得意外的自动旋转结果。

If your rotation code is setup correctly, you should need to have any version specific cases. If views do not reply with YES to shouldAutoRotateToInterfaceOrientation: for the orientations you desire, you will get unexpected results for automatic rotations.

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