如何设置导航栏字体的颜色ios
1个回答
展开全部
这个要用自定义的view 才能设置:方法如下
//设置标题
// self.title = @"title1";//修改title 会改变navigationItem。title ,但反之不会,一般设置title用此方法就好了
// self.navigationController.title = @"title2";
//
//自定义标题
// UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 44)];
// view.backgroundColor = [UIColor redColor];
UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 44)];
title.text = @"title3";
title.textAlignment = NSTextAlignmentCenter;
title.textColor = [UIColor redColor];
self.navigationItem.titleView = title;
//设置标题
// self.title = @"title1";//修改title 会改变navigationItem。title ,但反之不会,一般设置title用此方法就好了
// self.navigationController.title = @"title2";
//
//自定义标题
// UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 44)];
// view.backgroundColor = [UIColor redColor];
UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 44)];
title.text = @"title3";
title.textAlignment = NSTextAlignmentCenter;
title.textColor = [UIColor redColor];
self.navigationItem.titleView = title;
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询