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】;

相關文章
相關標籤/搜索