如何设置导航控制器上面的title的字体的颜色

2025-05-08 02:43:57
推荐回答(1个)
回答1:

可以设置UIViewControoler的navigationItem下的titleView; UILabel *t = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)]; t.font = [UIFont systemFontOfSize:12]; t.textColor = [UIColor whiteColor]; t.backgroundColor = [UIColor clearColor]; t.textAlignment = UITextAlignmentCenter; t.text = @"test"; self.navigationItem.titleView = t; [t release];