Cannot set uilabel font in ios 7( not using custom font)

余生颓废 提交于 2019-12-12 21:40:28

问题


Background: font using: AppleSDGothicNeo-Light

ios supporting: ios7+

Issue: I set the font for uilabel by:

self.lblName.font = [UIFont fontWithName:@"AppleSDGothicNeo-Light" size:12.f];

What I expected:

What I got in iOS7(iOS8 is alright):

When I want to print out the debug description, it got: font-family: "AppleSDGothicNeo-Light"; font-weight: normal; font-style: normal; font-size: 12.00pt

what happened?


回答1:


i hope it will help you..

UIFont *myFont = [UIFont fontWithName:@"AppleSDGothicNeo-Light size:12];
[yourLable setFont:myFont];


来源:https://stackoverflow.com/questions/28272856/cannot-set-uilabel-font-in-ios-7-not-using-custom-font

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!