Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-7919] Android: UI components: textAlign property and Titanium.UI.TEXT_ALIGNMENT: alignment not respected

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-03-14T14:39:11.000+0000
Affected Version/sRelease 2.0.0
Fix Version/sRelease 2.0.0, Sprint 2012-06
ComponentsAndroid
Labelsregression
ReporterDustin Hyde
AssigneeHieu Pham
Created2012-03-07T14:59:20.000+0000
Updated2012-03-15T16:32:09.000+0000

Description

The textAlign property is not respected in UI components. Regression. Does not occur in 1.8.2 or iOS. Does not appear to be an expected UI Layout change. Tested on Button, TextField, and Label. Steps to Reproduce: 1. Run code.
var textAlign = Ti.UI.TEXT_ALIGNMENT_CENTER;

var win = Ti.UI.createWindow({
	backgroundColor:'white'
});

var button = Ti.UI.createButton({
	top:'80%',
    bottom:'5%',
    left:'10%',
    right:'10%',
    title:'This is the button title.',
    textAlign:textAlign
});

var textField = Ti.UI.createTextField({
    top:'30%',
    bottom:'30%',
    left:'10%',
    right:'10%',
    borderWidth:'2',
    borderColor:'black',
    value:'This is the textField value.',
    textAlign:textAlign
});

var label = Ti.UI.createLabel({
	text:'This is the label text.',
	top:'10%',
    bottom:'80%',
    left:'10%',
    right:'10%',
    textAlign:textAlign
});

win.add(label);
win.add(button);
win.add(textField);
win.open();
Expected Result: Text alignment should be centered for all UI components, as specified in the code. Actual Result: Text alignment is not respected. The label and button texts are higher and left-aligned. The textField text is higher.

Attachments

FileDateSize
1.8.2 textAlign correct.png2012-03-07T14:59:20.000+000022185
2.0.0 textAlign regression.png2012-03-07T14:59:20.000+000021857

Comments

  1. Dustin Hyde 2012-03-15

    Closing as Fixed. SDK: 2.0.0.v20120315140247 Android: V8, Rhino Studio: 2.0.0.201203142055 OS: Snow Leopard Devices Tested: Emulator 2.2, Emulator 2.3.3, Xoom 3.2.1

JSON Source