0

What would be the best way to implement a multiline text on a UIButton for iPhone SDK 3.2?

Thanks! Nicolas.

  • possible duplicate of [How do you add multi-line text to a UIButton?](http://stackoverflow.com/questions/604632/how-do-you-add-multi-line-text-to-a-uibutton) – Alex Reynolds Jul 13 '10 at 17:36
  • The first, best way is to click on the search field in the top-right corner of the Stack Overflow page. – Alex Reynolds Jul 13 '10 at 17:37

1 Answers1

1

If adding newline characters (\n) to your title text doesn't work, you could try adding a UILabel with an appropriate numberOfLines as a subview of the button.

Noah Witherspoon
  • 57,021
  • 16
  • 130
  • 131
  • Let me verify and I'll keep you posted. Thanks! –  Jul 13 '10 at 17:52
  • 4
    I found it guys. Keep it simple. As you know, there is a UILabel in the button. So, you can set the numberOfLines to 0 and textAlignment to UITextAlignmentCenter for the label. It will do the job. –  Jul 13 '10 at 19:08