使用iOS 4.2.1的3GS设备上的奇怪布局问题 - 使用iOS 5编译 [英] Strange layout issue on 3GS device with iOS 4.2.1 - Compiled with iOS 5

查看:75
本文介绍了使用iOS 4.2.1的3GS设备上的奇怪布局问题 - 使用iOS 5编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们收到了iPhone 3GS上有iOS 4.2.1的用户的奇怪错误报告。应用程序中的许多UITextLabel在奇怪的位置偏移。是否有其他人遇到过这个问题。

We had a strange bug report from a user who has iOS 4.2.1 on an iPhone 3GS. A lot of the UITextLabels in the app are offset at strange locations. Has anyone else come across this issue.

该应用程序在我们测试过的所有设备上都已正确布局,我们只听到了来自2个用户的此问题100,000美元。

The app is laid out correctly on all devices we have tested on and we have only heard of this issue from 2 users out of over 100,000.

这可能与Three20风格有关。

This could be related to Three20 styles.

推荐答案

我们的布局遇到了完全相同的问题。我们不是在使用Three20。使用iOS 5.0构建并在iOS 4.2.1上运行时会出现一个已知问题,在使用优化代码后会导致CGRects初始化不正确。 (即使用最快,最小的优化级别编译),因此在通常将此设置为无的调试版本上进行测试时,您将看不到它。

We hit exactly the same issue with our layouts. We are not using Three20 though. There is a known issue when building with iOS 5.0 and running on iOS 4.2.1 that causes CGRects to be initialised incorrectly once you are using optimised code. (ie compiled with the fastest,smallest optimization level) so you won't see it when testing on a debug version which usually has this set to None.

有一个修复它的解决方法。您只需要为以下内容添加编译器标志:

There is a workaround to fix it. You simply need to add a compiler flag for:

OTHER_CFLAGS [arch = armv6]= - mno-thumb;

"OTHER_CFLAGS[arch=armv6]" = "-mno-thumb";

(您可以将其直接添加到项目文件中或从项目的构建设置选项卡中添加。)

(You can add this either directly into the project file or from the build settings tab of the project).

请参阅苹果论坛帖子解释完整的问题:

Please see an apple forum thread explaining the complete issue:

https://devforums.apple .com / thread / 122059?tstart = 15

这篇关于使用iOS 4.2.1的3GS设备上的奇怪布局问题 - 使用iOS 5编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆