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

2

5

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.

misaligned text

enter image description here

Obelia answered 15/11, 2011 at 14:10 Comment(5)
You should mention Three20 in your headline and in the first line of your question, as this is almost certainly the source of your problem. Also, why would you use something like Three20? Laying out tableviews is really not especially difficult, and using a third-party library (for anything, really) exposes you to this kind of hard-to-debug problem.Illtreat
can we see the code related to this TTTableItemCells? it's probably a reuse issue either in the layoutSubviews or the prepareToReUse functionSnowdrift
I don't think it's a reuse issue as the back button text is also offObelia
Point taken, it's annoying to have to rely on a 3rd party library, but Three20 has some really nice features like styled text, image caching, photo browser, styled buttons etc. Regardless, it would require a ground-up rewrite to remove three20.Obelia
We have similar issues reported for our iPhone app which uses Three20's TTLauncherView: similar problems, similar apparent rarity. We are going to switch to Nimbus, which is basically Three20 built from the ground up with much better documentation and - hopefully - less issues.Prisca
W
9

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

Wring answered 5/12, 2011 at 15:40 Comment(4)
Thank you so much for this! I was banging my head against this for hours trying to figure out why my UIView's center property had funny values after setting the frame. To be clear, this is NOT in any way related to Three20, it is a 4.2.1 issue on armv6. -mno-thumb cleared it up. Thanks again!Allopatric
Great thanks for that! For instructions on how to add this flag using the ui see: #8391106Obelia
Dear user! You can't even imagine how much I love you at the moment!Woundwort
Thank you user973793 for solving this issue with Xcode optimization problem! And thank you Eamonn for posting the original question! Reading the apple forum discussion, this issue still exists in Xcode 4.2.1 and is only repaired in Xcode 4.3 beta for now.Oisin
N
0

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)

Nabalas answered 16/11, 2011 at 10:52 Comment(1)
The user is no longer responding, so I'm not sure if jail breaking was the issue. I've added a jailbreak check now to the feedback email in the app. Thanks for that!Obelia

© 2022 - 2024 — McMap. All rights reserved.