开发者

uibutton text justify

I am trying to left justify text on a UIButton. It is middle justified by default. The following doesnt seem to work. Can so开发者_开发知识库meone suggest what may work.

  aButton.titleLabel.textAlignment = UITextAlignmentLeft; 


You have to set the label alignment, not the text alignment.

aButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜