[TIMOB-11739] BlackBerry: Titanium.UI.Label - textAlign not working
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-06-18T01:01:42.000+0000 |
Affected Version/s | Release 3.1.1, Release 3.2.0 |
Fix Version/s | 2013 Sprint 12 BB, 2013 Sprint 12, Release 3.2.0 |
Components | BlackBerry |
Labels | 3.1.2, blackberry, qe-testadded |
Reporter | Dan Tamas |
Assignee | Russell McMahon |
Created | 2012-11-10T17:33:49.000+0000 |
Updated | 2014-06-19T12:43:31.000+0000 |
Description
var win = Ti.UI.createWindow({
backgroundColor:'#f00'
});
win.open();
var lbll = Ti.UI.createLabel({
text:'left',
top:0,
width:'100%',
backgroundColor:'#fff',
textAlign:'left'
});//
win.add(lbll);
var lblr = Ti.UI.createLabel({
text:'right',
top:50,
width:'100%',
backgroundColor:'#fff',
textAlign:'right'
});//
win.add(lblr);
var lblc = Ti.UI.createLabel({
text:'center',
top:100,
width:'100%',
backgroundColor:'#fff',
textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER
});//
win.add(lblc);
var tf = Ti.UI.createTextField({
top: 150,
value: 'hello world!',
textAlign:'center'
});
win.add(tf);
Result attached
Attachments
File | Date | Size |
---|---|---|
capture-7.png | 2012-11-10T17:33:49.000+0000 | 42323 |
I can verify this. In some of my Alloy unit testing I assert that certain properties are present and defined on proxy objects. This works well in most cases, but fails anytime I try to check for textAlign on a Ti.UI.Label. It's as if the property doesn't even exist, it's totally undefined, even when assigning it as in the test case above.
Looks like we only support the alignment constants (ex: TEXT_ALIGNMENT_LEFT). Need to implement support for parsing string values (ex: "left").
Modified test case to also test "left" alignment. Also added a text field to verify that works as well.
Created pull request [#76](https://github.com/appcelerator/titanium_mobile_blackberry/pull/76) for master branch.
textAlign working fine for label. Hence closing as fixed. Verified with environment Appcelerator Studio: 3.2.0.201311120707 SDK:3.2.0.v20131111174605 alloy: 1.3.0 acs: 1.0.7 npm: 1.3.2 titanium: 3.2.0 titanium-code-processor: 1.0.3 Xcode:5.0.1 Device: Blackeberry Z 10 OS: Mac OSX 10.9 BB OS 10.0.10.261