我有一个简单的基于导航的 iphone/objective-c 应用程序
在被插入 View 的各种 UIViewController 中,我可以使用类似的东西设置标题栏中的文本
self.title = @"blah blah blah"
有没有办法控制标题栏文本中标题的字体和字体大小?
谢谢!
最佳答案
调整导航 Controller 标题文本大小的正确方法是设置导航项的 titleView 属性
像这样(在 viewDidLoad 中)
UILabel* tlabel=[[UILabel alloc] initWithFrame:CGRectMake(0,0, 300, 40)];
tlabel.text=self.navigationItem.title;
tlabel.textColor=[UIColor whiteColor];
tlabel.backgroundColor =[UIColor clearColor];
tlabel.adjustsFontSizeToFitWidth=YES;
self.navigationItem.titleView=tlabel;
关于iphone - 在 UITableViewController 中设置标题栏文本的字体和字体大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1545975/