不能在ios 7中设置uilabel字体(不使用自定义字体) [英] Cannot set uilabel font in ios 7( not using custom font)

查看:203
本文介绍了不能在ios 7中设置uilabel字体(不使用自定义字体)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:
字体使用:AppleSDGothicNeo-Light



ios支持:ios7 +




我为uilabel设置字体:

  self.lblName.font = [UIFont fontWithName:@AppleSDGothicNeo - 大小:12.f; 

我期望的是:
$ / $> $ / $> b
$ b



当我想打印调试描述时,得到:
font-family:AppleSDGothicNeo-Light; font-weight:正常; font-style:normal; font-size:12.00pt


发生了什么? 希望它能帮助你..

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


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?

解决方案

i hope it will help you..

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

这篇关于不能在ios 7中设置uilabel字体(不使用自定义字体)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆