Set the contentHorizontalAlignment:
btn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
You might also want to adjust the content left inset otherwise the
text will touch the left border:
btn.contentEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
No comments:
Post a Comment