For a project I bought a OTF
font and included it into my project (with adding to plist file etc). It works and I can set the font on my buttons, but the label is displaced then. I added a screenshot so you can see my issue. Anyone an idea what the problem can be?
system: iPad 3 with iOS 6.0 beta, but same problem on iOS 5.1.1
EDIT:
I found a post about the problem.
http://www.andyyardley.com/2012/04/24/custom-ios-fonts-and-how-to-fix-the-vertical-position-problem/
Ok, now I got it :) Just look at the blogpost I linked in my question.
http://www.andyyardley.com/2012/04/24/custom-ios-fonts-and-how-to-fix-the-vertical-position-problem/
summary:
您可以将UIButton
的文本位置重新对齐:
[_button setTitleEdgeInsets:UIEdgeInsetsMake(0.f, 0.f, 10.f, 0.f)]; // e.g.
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.