Simon
Simon

Reputation: 1125

Appcelerator Style Button Image Android

I have a piece of code which generates the button:

var call_buttons = Titanium.UI.createButton({
    id: resultNodeID,
    title: resultNodeTitleNoQuotes + ", " + "Rating: " + ratings,
    font: { fontSize:23 },
    top: 1, 
    left: '3%',
    width: '94%', 
    height: '94%',
    image : 'star.png' 
 });

And on the app it looks like this: Android Button

How do I style the star so it moves to the right hand side of the android button, not the left? I have read the documentation (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Button) but can not find anything relating to the position of the image inside a button.

The goal is to place the star where the word "Rating" is.

Upvotes: 0

Views: 774

Answers (2)

Fokke Zandbergen
Fokke Zandbergen

Reputation: 3866

Another option would be to use an Attributed String as title and use a Icon Font for the star. But... Titanium's button does not support Attributed String.

You might want to do a Feature Request Appcelerator JIRA. Check if it has already been requested before you create a new ticket. Refer to this question and also link back to the ticket here so that others can watch it with you.

Upvotes: 0

Ray
Ray

Reputation: 486

The image property only allows the image placed to the left of the button title. If you want to place an image to the right, I would suggest creating a view that acts like a button (attach a click event to the view) then place your label to the left and an image to the right inside the view to get the look you want.

Upvotes: 3

Related Questions