[TIMOB-9107] Android: Label is not centering vertically inside a button
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Duplicate |
| Resolution Date | 2012-05-16T17:25:02.000+0000 |
| Affected Version/s | Release 2.0.1 |
| Fix Version/s | n/a |
| Components | Android |
| Labels | core |
| Reporter | Shannon Hicks |
| Assignee | Neeraj Gupta |
| Created | 2012-05-03T11:18:21.000+0000 |
| Updated | 2017-03-22T22:11:27.000+0000 |
Description
I can't quite pinpoint the problem, but the label is not centering vertically inside a button when you add a background image. This was not a problem in Ti 2.0. Here's some sample code:
in tiapp.xml:
<android xmlns:android="http://schemas.android.com/apk/res/android">
<manifest android:installLocation="auto">
<uses-sdk android:minSdkVersion="7"/>
<supports-screens android:anyDensity="false"
android:largeScreens="false"
android:normalScreens="true" android:smallScreens="false"/>
</manifest>
</android>
app.js:
var win = Ti.UI.createWindow();
var buttonTest = Ti.UI.createButton({
height:28,
width:200,
title:'Button 1',
top:20,
font:{fontSize:12,fontWeight:'bold'},
backgroundImage:'/assets/button_background.png',
});
win.add(buttonTest);
win.open();
I've attached the background image. When run on Android, it appears that the baseline of the text is at the button's vertical center. When run on iOS, it displays correctly.
Attachments
| File | Date | Size |
|---|---|---|
| button_background.png | 2012-05-03T11:18:21.000+0000 | 2048 |
Looks like this is probably a dupe of TIMOB-9055
Resolving as dup. Looks like TIMOB-9055 was fixed in master on 5/11, so any CI build after that ought to include the fix if you want to test it against your app.
I can confirm that TIMOB-9055 resolved my issue
Closing ticket as duplicate and links to the related ticket have been provided above.