开发者

uibutton text justify

开发者 https://www.devze.com 2023-01-19 16:28 出处:网络
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.

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

精彩评论

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