UIButton标题的对齐方式默认为居中,在自定义为左对齐时发现:
button.titleLabel.textAlignment=UITextAlignmentLeft;方法并没有生效
正确的做法应该是:
[button setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];
UIButton标题的对齐方式默认为居中,在自定义为左对齐时发现:
button.titleLabel.textAlignment=UITextAlignmentLeft;方法并没有生效
正确的做法应该是:
[button setContentHorizontalAlignment:UIControlContentHorizontalAlignmentLeft];