这是代码,这将显示默认大小,我想改变标题的字体大小becoz这个标题太大n没有显示整个“库克大印度...”显示... pl让我帮忙如何更改iPhone中的标题字体大小?
- (void)viewDidLoad {
self.title = @"Cook Great Indian Recipes";
}
这是代码,这将显示默认大小,我想改变标题的字体大小becoz这个标题太大n没有显示整个“库克大印度...”显示... pl让我帮忙如何更改iPhone中的标题字体大小?
- (void)viewDidLoad {
self.title = @"Cook Great Indian Recipes";
}
您不能更改title
的字体。请改为使用您自己的自定义创建UILabel
,并将其指定为navigationItem的titleView
。
UILabel *titleLbl = [[UILabel alloc] init];
label.frame = CGRectMake(...
label.font = [UIFont ...
// And the other things
self.navigationItem.titleView = titleLbl;
[titleLbl release];
thnx为你的回应bt这是行不通的... –
尝试设置的自定义标签标题标签:
self.title = @"Cook Great Indian Recipes";
CGRect frame = CGRectMake(0, 0, [self.title sizeWithFont:[UIFont boldSystemFontOfSize:20.0]].width, 44);
UILabel *label = [[UILabel alloc] initWithFrame:frame];
label.backgroundColor = [UIColor clearColor];
label.font = [UIFont boldSystemFontOfSize:17.0];
label.textAlignment = UITextAlignmentCenter;
self.navigationItem.titleView = label;
label.text = self.title;
[label release];
thnx伙计这是工作perfactly.1.1c再次thnx给予例如.. –
从厦门国际银行的属性检查器,可以eaisly实现它。 – rptwsthi