Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9055] Android: The text in a button is not centered, it's slightly up

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-05-11T09:35:26.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.0.2, Release 2.1.0, Sprint 2012-10 Core
ComponentsAndroid
LabelsSupportTeam, core, module_button, qe-testadded, regression
ReporterMauro Parra-Miranda
AssigneeAllen Yeung
Created2012-05-08T11:00:03.000+0000
Updated2013-01-18T23:40:43.000+0000

Description

Problem Description

In 1.7.6, when you centered the text in a button, you will get it in the center vertical and horizontal. With 2.1CI, the text will appear more close to the top.

Actual Results

The text is closer to the top

Expected results

The button should be in the center, either vertical and horizontal

Test Case

1. Create a new mobile Project 2. Paste this code:

var winMain = Ti.UI.createWindow({
	backgroundColor : 'white',
	fullscreen : false,
	navBarHidden : true
});


var logoutButton = Ti.UI.createButton({
	title : 'Logout',
	backgroundColor:'orange',
	//backgroundImage:'none',
	width : 60,
	height : 40,
	top : 100,
	font : {
		fontSize : 12,
		fontfamily : 'Helvetica Neue',
		fontWeight : 'bold'
	}
});
winMain.add(logoutButton);

winMain.open();
3. Test in 1.7.6 4. Test in 2.1CI

Extra info

The example can be seen in pic210.png for the 2.1CI, and in pic2_176.png for the 1.7.6

Attachments

FileDateSize
pic2_176.png2012-05-08T11:00:03.000+000017168
pic210.png2012-05-08T11:00:03.000+000017615

Comments

  1. Allen Yeung 2012-05-10

    PR ready: https://github.com/appcelerator/titanium_mobile/pull/2171
  2. Natalie Huynh 2012-05-17

    Tested with 2.0.2.v20120516181650 on LG Revolution 2.3.6

JSON Source