Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11739] BlackBerry: Titanium.UI.Label - textAlign not working

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-18T01:01:42.000+0000
Affected Version/sRelease 3.1.1, Release 3.2.0
Fix Version/s2013 Sprint 12 BB, 2013 Sprint 12, Release 3.2.0
ComponentsBlackBerry
Labels3.1.2, blackberry, qe-testadded
ReporterDan Tamas
AssigneeRussell McMahon
Created2012-11-10T17:33:49.000+0000
Updated2014-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

FileDateSize
capture-7.png2012-11-10T17:33:49.000+000042323

Comments

  1. Tony Lukasavage 2013-05-10

    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.
  2. Josh Roesslein 2013-05-10

    Looks like we only support the alignment constants (ex: TEXT_ALIGNMENT_LEFT). Need to implement support for parsing string values (ex: "left").
  3. Josh Roesslein 2013-06-04

    Modified test case to also test "left" alignment. Also added a text field to verify that works as well.
  4. Josh Roesslein 2013-06-04

    Created pull request [#76](https://github.com/appcelerator/titanium_mobile_blackberry/pull/76) for master branch.
  5. Priya Agarwal 2013-11-12

    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

JSON Source