小编Har*_*n.P的帖子

如何在xcode中为Iphone应用程序导入字体

我导入了我的app文件夹中的字体.然后我在info.plist文件中添加了字体.喜欢.....应用程序提供的字体--->添加两个字体.

然后将字体设置为title.After创建UILabel以设置字体.像这样

 self.title = @"Home";
CGRect frame = CGRectMake(0, 0,100, 44);
label = [[UILabel alloc] initWithFrame:frame];
label.backgroundColor = [UIColor clearColor];
label.font = [UIFont fontWithName:@"Benguiat Gothic" size:9];
label.textAlignment = UITextAlignmentCenter;
self.navigationItem.titleView = label;
label.text =self.title;
Run Code Online (Sandbox Code Playgroud)

这段代码用viewdidload方法编写.

但字体不会更改.它只显示该标签的默认字体.

fonts objective-c ios

0
推荐指数
1
解决办法
2349
查看次数

标签 统计

fonts ×1

ios ×1

objective-c ×1