If I have a UIButton arranged using autolayout, its size adjusts nicely to fit its content.
If I set an image as button.image
, the instrinsic size again seems to account for this.
However, if I tweak the titleEdgeInsets
of the button, the layout does not account for this and instead truncates the button title.
How can I ensure that the intrinsic width of the button accounts for the inset?
Edit:
I am using the following:
[self.backButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)];
The goal is to add some separation between the image and the text.