Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13220] Android: Can not set width on label and ellipsize no longer works

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionFixed
Resolution Date2013-04-14T23:28:53.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.1.0, Release 3.2.0
ComponentsAndroid
Labelsandroid, label, module_label, qe-testadded, regression
ReporterTommy Leung
AssigneeAllen Yeung
Created2013-03-23T15:30:33.000+0000
Updated2013-10-15T23:42:05.000+0000

Description

Problem

Setting width property of label does nothing, and ellipsize stopped working because of it. This works with Ti SDk 3.1.0.v20130304xxxx

Test case

var win  = Ti.UI.createWindow();


win.add(Ti.UI.createLabel({
	text: 'this is some text that should ellipsize because it is too long',
	width: 100,
	height: 25,
	color: 'white',
	ellipsize: true,
	wordWrap: false,
	backgroundColor: 'pink'
}));


win.open();


Attachments

FileDateSize
Screenshot_2013-03-23-11-27-46.png2013-03-23T15:30:33.000+000019951

Comments

  1. Jamie Buckley 2013-03-25

    Works correctly when label is created before being added to window, which it should be. Tested with code below and ellipsize works fine
       var win  = Ti.UI.createWindow({
       	backgroundColor: 'black'
       });
        
       var label1 = Ti.UI.createLabel({
           text: 'this is some text that should ellipsize because it is too long',
           width: 100,
           height: 25,
           color: 'white',
           ellipsize: true,
           wordWrap: false,
           backgroundColor: 'pink'
       });
       
        win.add(label1)
        
       win.open();
       
  2. Tommy Leung 2013-03-26

  3. Tommy Leung 2013-04-14

    I thought maybe I'll bring this up again since 3.1.0 is about to be released. It's still broken with the latest CI build (3.2.0 and 3.1.0) on Apr 11. It's going to break any app that uses ellipsis on android.
  4. Allen Yeung 2013-04-14

    PR: https://github.com/appcelerator/titanium_mobile/pull/4159 Backport to 3_1_X: https://github.com/appcelerator/titanium_mobile/pull/4160
  5. Anshu Mittal 2013-04-15

    Tested with: SDK: 3.1.0.v20130414163049 Titanium Studio:3.1.0.201304141748 Device: Samgung galaxy note(2.3.6) OS: OSX 10.7.5 Ellipsis works fine on above env.
  6. Yuri Goldfeld 2013-10-15

    The fix above does not fully fix the bug. It works when .width is specified. It fails to work when width is specified indirectly via .left and .right instead. As a work-around, one may specify .width (e.g., as Ti.UI.FILL) AND .left and .right to be specific values. I would advise reopening this ticket.

JSON Source