Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3353] Label with auto height shows a display inconsistency on text value update.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-06-20T22:23:27.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterRadu.V
AssigneeIngo Muschenetz
Created2011-04-15T03:43:06.000+0000
Updated2017-06-20T22:23:27.000+0000

Description

//Using Titanium 1.6.1 on iOS 4.2

var row = Ti.UI.createTableViewRow();
row.hasChild = true;

var label = Ti.UI.createLabel({
text: "Updating",
textAlign: 'left',
font: {
   fontSize: 13
},
bottom: 5,
height: 16,
left: 10, 
right: 50
});

row.add(label);

//update text after database query
//Case 1:
label.text = "Some long text that would cause it to display on two lines"

//Case 2:
label.text = "Some short text"

//event called after a remote server updated our local info
//this happens in a closure to keep a reference to label
Ti.App.addEventListener('someEvent', function(e) {
    label.text = "Some other long text to display possibly on two lines"
});

// [More code not related ...]
// Add row to a table view, and the table view to the current tab window

Test results:
Case 1:
At this moment as the view is attached to the window the label is displayed on two lines.

The event is triggered, at a later time, the new text is put on two lines.

Case 2:
At this moment as the view is attached to the window the label is displayed on one line, since the text is short enough to fit on one line.

The event is triggered, at a later time, the new text which too long for a single ine is cut off and '...' attached to the end of the text

So it looks like the view will not grow automatically at a later time. I don't know what the intended behavior is.
And I could not find any setting to choose a default behavior.

I hope this is clear enough.
Thank you for your time guys.

Comments

  1. Lee Morris 2017-06-20

    Closing ticket due to time passed and lack of progress since 2011. The test case is also invalid.

JSON Source