Multi-line uibutton

How to set multi-line title UIButton

in iPhone programming?

-five


a source to share


4 answers


someButton.lineBreakMode = UILineBreakModeWordWrap;

      



Be sure to try referring to the documentation before posting the question. Apple's documentation is pretty extensive and things like this are usually covered.

+7


a source


Hello,

There is a UIButton property called lineBreakMode that will allow you to add multi-line headers. The two main things I would install are UILineBreakModeWordWrap or UILineBreakModeCharacterWrap.

UILineBreakModeWordWrap wraps the last word and UILineBreakModeCharacterWrap wraps the last file.



as follows: instanceOfUIButton.lineBreakMode = UILineBreakModeWordWrap;

or instanceOfUIButton.lineBreakMode = UILineBreakModeCharacterWrap;

hope that what you are after

+2


a source


Please don't use subviews.

someButton.lineBreakMode = UILineBreakModeWordWrap; 

      

this is the correct way to do it. There is a tutorial for the German community!

http://bedifferently.wordpress.com/2011/11/16/uibutton-bearbeite-den-titel-teil-1/

+1


a source


UIButton does not display multiple lines. The way to do it is to add addSubview UILabel to the button

-1


a source







All Articles