Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1354] Orientation and layout issues

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T02:50:16.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsdefect, ios, iphone
ReporterKevin Whinnery
AssigneeBlain Hamon
Created2011-04-15T02:50:16.000+0000
Updated2017-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:

  1. In Tab1, switch to landscape mode (command + left arrow).
  2. Then move to Tab2, and notice that the text has not been reformatted.
  3. While still in Tab2, switch back to portrait mode (command + right arrow)
  4. 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.

Comments

  1. Mike 2011-04-15

    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.

  2. Blain Hamon 2011-04-15

    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.

  3. Mike 2011-04-15

    I removed the width settings on lines 49 and 83, and the problem persists.

  4. Mike 2011-04-15

    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.

  5. Blain Hamon 2011-04-15

    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.

  6. Mike 2011-04-15

    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.

  7. Mike 2011-04-15

    bashes face into desk vigorously

  8. Mike 2011-04-15

    Kevin, do you have a minute to confirm if Blain's fix works for you?

  9. Nikolai Derzhak 2011-04-15

    rollback wrong update
  10. Lee Morris 2017-03-09

    Closing ticket as invalid.

JSON Source