navigationBar的透明问题

(1)若是仅仅想要navigationBar透明,按钮和标题都在。app

  [self.navigationController.navigationBar setBackgroundImage:[UIImage  new] forBarMetrics:UIBarMetricsDefault];orm

(2)去掉导航的分割线的就须要在加入一句话:it

 self.navigationController.navigationBar.shadowImage = [UIImage new];io

若是你想要实现上拉导航渐变的就须要从它的内部入手object

  [self.navigationController.navigationBar subviews] objectAtIndex:0].alpha = 0;//这里能够根据scrollView的偏移量来设置alpha就实现了渐变透明的效果scroll

三、全局设置navigationBar标题的样式和barItem的标题样式方法

//UIColorWithHexRGB( )这个方法是本身定义的,这里只须要给个颜色就行了样式

[[UINavigationBar appearance] setBarTintColor:UIColorWithHexRGB(0xfefefe)];view

[[UINavigationBar appearance] setTitleTextAttributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18],NSForegroundColorAttributeName:UIColorWithHexRGB(0xfe6d27)}];vi

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSize:10],NSForegroundColorAttributeName : UIColorWithHexRGB(0x666666)} forState:UIControlStateNormal];

[[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont boldSystemFontOfSiz】;

相关文章
相关标签/搜索