In my app, I used custom fonts. It works fine for UILabels, etc...

But the Title is cut from top for Button.

enter image description here

"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:

  1. Include your fonts in your XCode project
  2. Make sure that they’re included in the target
  3. Double check that your fonts are included as Resources in your bundle
  4. Include your iOS custom fonts in your application plist
  5. Find the name of the font
  6. Use UIFont and specify the name of the font

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top