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??
尝试设置button.contentEdgeInsets
属性以使按钮内的标题对齐,如果这是字体基线错误的问题,则可以执行此操作
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.