How to alignment the text of button to the left?

后端 未结 5 2015
轻奢々
轻奢々 2021-02-03 18:46

Now I want to alignment the text of button to the left with code , how to do ? and I code this :

button.titleLabel.textAlignment = UITextAlignmentLeft;
         


        
5条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-03 19:34

    Use ContentHorizontalAlignment as below

    btnObj.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    

提交回复
热议问题