[TIMOB-1354] Orientation and layout issues
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T02:50:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | defect, ios, iphone |
Reporter | Kevin Whinnery |
Assignee | Blain Hamon |
Created | 2011-04-15T02:50:16.000+0000 |
Updated | 2017-03-09T23:18:35.000+0000 |
Description
http://developer.appcelerator.com/question/45041/switching-between-landscapeportrait--screwed-up-table-views"> Community Q&A item
It seems that text is not properly reformatted when the application switches between landscape and portrait mode. I put together a very small sample app (~100 lines of code): http://pastie.org/1054148">http://pastie.org/1054148
To see what I mean, just fire up the code and do the following:
- In Tab1, switch to landscape mode (command + left
arrow).
- Then move to Tab2, and notice that the text has not been
reformatted.
- While still in Tab2, switch back to portrait mode (command +
right arrow)
- Move back to Tab1, and notice the text is also screwed up there
NOTE:
I duplicated this behavior on 1.3.3 version from head.
Is anyone ever going to look at this bug? It's been like 6 months. I'd like to support landscape view in my Titanium apps.
My apologies for not looking at this earlier. It's actually due to the sample code requesting two conflicting widths. That is, there's the width set to 'auto', which instructs the text field to stretch as far as it can horizontally to hopefully fit the text in one line. But there's also the fact that the containing row has a fixed width, and the label wants to have left and right margins of 10 within that.
It's not straightforward, and we still need to work on both ensuring the algorithm is the right behavior to go, and if so, educating people on it. 'Auto' can be misleading as it's meant for 'Size to fit my contents, regardless of the parent's bounds,' and it sometimes feels like 'Do what I mean.'
Either way, if you remove the extra autos (Lines 49 and 83), which undoes the conflicting widths issue, you'll get the desired effect.
I removed the width settings on lines 49 and 83, and the problem persists.
Your suggestion never did work for me, and by marking my item as invalid without trying your own suggestion, you've killed any hope I ever had (small, though it was) that this item might ever be addressed.
Actually, I tried my suggestion, and it worked fine. Would you like screenshots? Either way, the original bug is invalid, in that it's a misinterpretation of what auto is.
I just went back, created a brand new project, copied the code from the original pastie, then removed lines 49 and 83. It still does not work correctly in the emulator or on my iPhone device. Did you change something in addition to those two lines which you forgot to mention?
If it's a misinterpretation of auto, I can accept that - but please show me what I need to do to this code to correct it. Please note that there are 4 short reproduction steps.
I am using iPhone SDK 4.1. I tested with 1.3.2 (in which I initially reported the problem) and 1.4.2.
bashes face into desk vigorously
Kevin, do you have a minute to confirm if Blain's fix works for you?
rollback wrong update
Closing ticket as invalid.