UIButton title alignment and multiline support

Raju picture Raju · Jun 5, 2009 · Viewed 45.4k times · Source

How do I set the title of a UIButton to be left-aligned, and how can I show multiple lines of text in a UIButton?

Answer

Ian Kershaw picture Ian Kershaw · Aug 4, 2009

Here's the code to do the UIButton alignment in code too: -

[myButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];