Moh*_*ani 2 uifont ios apple-watch watchkit
我正在尝试设置Roboto字体,并已添加为手表套件扩展的目标,但它仍然是零.我们可以在手表套件中设置自定义字体.
它对我有用..使用以下代码.
将自定义Font添加到WatchKit Extension和WatchKit App目标Info.plist

现在你按照以下方式编写代码,
NSMutableAttributedString *attString =[[NSMutableAttributedString alloc]
initWithString: @"Yano rocks! Always"];
[attString setAttributes:@{NSFontAttributeName:[UIFont fontWithName:@"Open Sans" size:20.0]} range:NSMakeRange(0, attString.string.length)];
[self.loadingLabel setAttributedText:attString];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2987 次 |
| 最近记录: |