【发布时间】:2014-07-11 08:16:33
【问题描述】:
我在我的应用文件夹中导入字体。 然后我在 info.plist 文件中添加了字体。 喜欢.....应用程序提供的字体--->添加两种字体。
然后设置字体为title。创建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;
这段代码是用viewdidload方法写的。
但字体没有改变。它只显示该标签的默认字体。
【问题讨论】:
-
你在 info.plist 中到底写了什么?
-
对此有很多答案...stackoverflow.com/a/2616101/294884
-
谢谢朋友们...现在它正在使用此网址解决问题codewithchris.com/…
标签: ios objective-c fonts