OGeek|极客世界-中国程序员成长平台

标题: ios - 无法在 ios 7 中设置 uilabel 字体(不使用自定义字体) [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 14:00
标题: ios - 无法在 ios 7 中设置 uilabel 字体(不使用自定义字体)

背景: 字体使用:AppleSDGothicNeo-Light

ios支持:ios7+

问题: 我通过以下方式设置 uilabel 的字体:

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

我的预期: character C at iosFonts.com

我在iOS7中得到的(iOS8还可以):

Character C in iOS7

当我想打印调试描述时,它得到了: font-family: "AppleSDGothicNeo-Light";字体粗细:正常;字体样式:正常;字体大小:12.00pt

发生了什么?



Best Answer-推荐答案


希望对你有帮助..

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

关于ios - 无法在 ios 7 中设置 uilabel 字体(不使用自定义字体),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28272856/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4