I am having a trouble adding left padding on a UIButton. I have a UIButton with UIControlContentHorizontalAlignmentLeft. I want the text to be displayed on the left side but it is too left. when I give the border, it doesn’t look good. I would like to give some padding on the text about 5px like in CSS. I googled for the solution but can’t find one particularly for UIButton.
I am having a trouble adding left padding on a UIButton . I have
Share
Give this a try 🙂
Also if you’re using a custom button there is such a thing as Content Insets and Image Insets.
Incase you’ve made it here looking for Swift. This is valid Swift 3.0
You can set it directly as well. It is helpful if want to use one or two properties.