Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Button title + icon alignment

I'm looking at the Snapost code & like the look of the buttons for my initial menu of options. The app will be multi-language so the approach of using images with the text actually in the image isn't going to work for me.

The I've scrubbed some of your examples so that the background is plain, then I use the 'title' property, and 'icon' property.

There are 2 problems with this;

  1. There is no way to align the text + icon. It's centred and I'd rather they were left-aligned.

  2. On Android (SDK2.1) the icon is stretched across the whole button & the title font isn't the same as the iPhone (I guess specifying 'font' would sort this out).

var gallery = Titanium.UI.createButton({
    backgroundImage:'images/button-top.png',
    title:'Test',
    image:'images/icon-camera.png',
    top:0,
    width:229,
    height:42
});

imageControls.add(gallery);

Here's a screenshot to illustrate what I'm on about;

— asked June 8th 2010 by Matt Collinge
  • align
  • button
  • icon
  • title
0 Comments

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.