[TIMOB-13220] Android: Can not set width on label and ellipsize no longer works
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-04-14T23:28:53.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 3.1.0, Release 3.2.0 |
Components | Android |
Labels | android, label, module_label, qe-testadded, regression |
Reporter | Tommy Leung |
Assignee | Allen Yeung |
Created | 2013-03-23T15:30:33.000+0000 |
Updated | 2013-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.v20130304xxxxTest 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
File | Date | Size |
---|---|---|
Screenshot_2013-03-23-11-27-46.png | 2013-03-23T15:30:33.000+0000 | 19951 |
Works correctly when label is created before being added to window, which it should be. Tested with code below and ellipsize works fine
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.
PR: https://github.com/appcelerator/titanium_mobile/pull/4159 Backport to 3_1_X: https://github.com/appcelerator/titanium_mobile/pull/4160
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.
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.