如何在iOS中将UILabel的字体名称设置为HelveticaNeue Thin? [英] How to set font name of UILabel as HelveticaNeue Thin in iOS?

查看:75
本文介绍了如何在iOS中将UILabel的字体名称设置为HelveticaNeue Thin?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建UILabel,对于标签我可以将字体名称设置为HelveticaNeue Regular,Light,UltraLight等,但是我无法将字体名称设置为HelveticaNeue Thin,它无法正常工作.我确实喜欢,

I am creating UILabel, for the label i can set the font name as HelveticaNeue Regular, Light, UltraLight etc, But i unable to set the font name as HelveticaNeue Thin, it is not working as expected. I did like,

label.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:16];

我在Google上搜索时也没有任何解决方案.如何解决这个问题?谢谢.

Also i have searched on Google didnt got any solution. How to fix this issue? Thanks.

推荐答案

此字体与iOS 7捆绑在一起,因此,如果您的目标是iOS 7及更高版本

This font is bundled with iOS 7, so if you're targeting iOS 7 and above your

label.font = [UIFont fontWithName:@"HelveticaNeue-Thin" size:16.0f];

将起作用.

但是,如果您针对的是iOS 6.1及更低版本,则需要

However if you are targeting iOS 6.1 and below you'll need to embed the font

这篇关于如何在iOS中将UILabel的字体名称设置为HelveticaNeue Thin?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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