美文网首页
33 设置导航栏标题(titleView)的字体颜色和大小

33 设置导航栏标题(titleView)的字体颜色和大小

作者: rebeccaBull | 来源:发表于2017-04-24 10:51 被阅读0次

navgationBar 上的title设置的三种方法:

<1> self.title = @"我是title" ;

直接设置

<2> self.navigationItem.title = @"我是title" ;

以上两种方法 title的显示跟调用顺序有关,谁后调用显示谁

<3>  UILabel * titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 62, 20)] ;

titleLabel.text = @"我是title" ;

self.navigationItem.titleView = titleLabel ;

以上<3>的显示优先级是最高的  其实是<1><2>,<1><2>相互没有优先级,只跟调用顺序有关

相关文章

网友评论

      本文标题:33 设置导航栏标题(titleView)的字体颜色和大小

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