美文网首页
ios导航栏自定义

ios导航栏自定义

作者: 小小鸟想飞_123 | 来源:发表于2016-11-01 15:28 被阅读0次

在viewDidLoad函数里写上

//自定义导航栏颜色

[self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:50/255.0 green:147/255.0 blue:209/255.0 alpha:1]];

//自定义导航栏背景图片

[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg_banner10.png"] forBarMetrics:UIBarMetricsDefault];

//修改导航栏标题字体大小和颜色

[self.navigationController.navigationBar setTitleTextAttributes:@{

NSFontAttributeName:[UIFont systemFontOfSize:19],

NSForegroundColorAttributeName:[UIColor whiteColor]

}];

相关文章

网友评论

      本文标题:ios导航栏自定义

      本文链接:https://www.haomeiwen.com/subject/vwhyuttx.html