ios 怎么修改navigationitem的颜色
展开全部
这个要用自定义的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;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询