Strange layout issue on 3GS device with iOS 4.2.1 - Compiled with iOS 5

我与影子孤独终老i 提交于 2019-12-20 14:42:02

问题


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.

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.

This could be related to Three20 styles.


回答1:


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";

(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




回答2:


Ask the users if their device is jailbroken and if they installed any fonts on their device.
Or does your app come with new fonts?

I one had exactly the same issue on both mac and iOS when i added a custom font that replaced a system font.. (that was actually the same font but the OS was drawing it differently)



来源:https://stackoverflow.com/questions/8137619/strange-layout-issue-on-3gs-device-with-ios-4-2-1-compiled-with-ios-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!