I've embedded a couple fonts in my iOS app and am finding that they're not centered correctly in labels and buttons, they're too high on the y axis, is there any solution for this? At first I thought it was just a cheap font file I was using but then I tried it (just to see) with an Adobe font and it still has the issue.
The (a?) solution a friend of mine pointed out is to use the contentEdgeInsets property of the button, I set it to:
myButton.contentEdgeInsets = UIEdgeInsetsMake(10, 0, 0, 0);
To bump the text down 10 pixels and now the text is centered. Woot.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With