ios开发,button字体换行显示

button的标题如果太长的的话默认的情况显示不全,可以通过设

infoButton.titleLabel.numberOfLines = 2

linfoButton.titleLabel.lineBreakMode = UILineBreakModeWordWrap

 再将标题要换行的地方 加上\n  如title = @"hello \n world"

最后再重新设置标题       [infoButton setTitle:title forState:UIControlStateNormal];

 

posted @ 2013-03-27 16:03  X-Code  阅读(805)  评论(0编辑  收藏  举报