我导入了我的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方法编写.
但字体不会更改.它只显示该标签的默认字体.