try setting button.contentEdgeInsets
property to align the title within the button, if it is an issue of misligned baseline of the font you can do this
button.titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters
题
In my app, I used custom fonts. It works fine for UILabel
s, etc...
But the Title is cut from top for Button.
"See the S"
What is happening and how can I resolve this??
没有正确的解决方案
其他提示
try setting button.contentEdgeInsets
property to align the title within the button, if it is an issue of misligned baseline of the font you can do this
button.titleLabel.baselineAdjustment = UIBaselineAdjustmentAlignCenters
a few steps:
detail for this: http://codewithchris.com/common-mistakes-with-adding-custom-fonts-to-your-ios-app/
thanks!
In my case it was the font file that was corrupted. Try to open the ttf file in your mac, select the 'S' and see if the frame that appears cuts off the letter. My solution was to change the ttf file.