我想把UILabel的文本加粗

infoLabel=[[UILabel alloc]initWithFrame:CGRectMake(90,150, 200, 30)];
[infoLabel setText:@"Drag 14 more Flavors"];
[infoLabel setBackgroundColor:[UIColor clearColor]];
[infoLabel setFont:[UIFont fontWithName:@"Arial" size:16]];

[infoLabel setTextColor:[UIColor colorWithRed:193.0/255 
                                        green:27.0/255 
                                         blue:23.0/255 
                                        alpha:1 ]];

推荐答案

try

[infoLabel setFont:[UIFont fontWithName:@"Arial-BoldMT" size:16]];

如果你想要使用的字体在设备上可用,也值得判断一下

Objective-c相关问答推荐

NSViewController 中的 viewDidLoad?

导航回上一个视图控制器

UITextField secureTextEntry 带有自定义字体的项目符号?

对 nil 对象进行快速枚举

捕获组在 NSRegularExpression 中不起作用

.m 文件中的空@interface 声明是做什么用的?

'supportedInterfaceOrientations' 实现中的返回类型冲突: - 警告

UICollectionView 单元格 Select 和单元格重用

更改 UISearchBar 的字体大小

UITextField:键盘出现 timeshift 动视图

如何设置 NSPredicate 来查找具有 nil 属性的对象

UICollectionView 更新单个单元格

对 NSTimer 目标的弱引用以防止保留循环

100% 不透明度 UILabel 超过 50% 不透明度背景(UIView?)

如何本地化 iOS 故事板

Objective-c 2.0 中的可选参数?

判断文件是否存在于路径中

AppDelegate 的当前视图控制器?

Objective-C in,out,inout,byref,byval, .. 等等.这些是什么?

UICollectionView:如何检测滚动何时停止