Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10204] iOS: Button.textAlign does not work with Ti.UI.TEXT_ALIGN_*** constants.

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2013-03-27T08:49:02.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.2
ComponentsiOS
Labelsapi, ipass1
ReporterJosh Roesslein
Assigneejithinpv
Created2012-07-26T21:05:37.000+0000
Updated2017-03-20T22:01:44.000+0000

Description

When creating a Button and setting the "textAlign" with one of the TEXT_ALIGN_*** constants the text is not aligned properly. If you instead use a string value (ex: "right") it seems to work.

Button.textAlign example


var win = Ti.UI.createWindow();

var btn = Ti.UI.createButton({
	title: "Click me!",
	textAlign: Ti.UI.TEXT_ALIGNMENT_RIGHT,  // <-- this DOES NOT work
	//textAlign: "right",   <--- this works
	backgroundColor: 'red',
	width: 300, height: 50
});
win.add(btn);

win.open();

Comments

  1. jithinpv 2013-03-27

    according to titanium documentation http://docs.appcelerator.com/titanium/2.1/#!/api/Titanium.UI.Button-method-setTextAlign it doesn't specified that u have to use "Ti.UI.TEXT_ALIGNMENT_RIGHT" it should used in text field http://docs.appcelerator.com/titanium/2.1/#!/api/Titanium.UI.TextField-property-textAlign so it cannot be treated as a bug. Issue does not reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  2. Lee Morris 2017-03-20

    Closing ticket as invalid.

JSON Source