如题,在首页的导航栏是透明的,下面是轮播图,怎么通过self.navigationController push到另一个页面添加上不是透明,现在通过各种方法加不上颜色。
viewDidload里添加:
[self.navigationController.navigationBar lt_setBackgroundColor:[UIColor whiteColor]];
或
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
都不可行
viewDidload里添加:
[self.navigationController.navigationBar lt_setBackgroundColor:[UIColor whiteColor]];
或
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
都不可行
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.navigationBarHidden = YES;
}- (void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
self.navigationController.navigationBarHidden = NO;
self.navigationController.navigationBar.translucent = YES;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
//UIColor * color = [UIColor colorWithRed:225/255.0 green:225/255.0 blue:225/255.0 alpha:1];
UIColor *color=[UIColor whiteColor];
CGFloat offsetY = scrollView.contentOffset.y;
if (offsetY > NAVBAR_CHANGE_POINT) {
CGFloat alpha = MIN(1, 1 - ((NAVBAR_CHANGE_POINT + 64 - offsetY) / 84));
[self.navigationController.navigationBar lt_setBackgroundColor:[color colorWithAlphaComponent:alpha]];
} else {
[self.navigationController.navigationBar lt_setBackgroundColor:[color colorWithAlphaComponent:0.6]];
}
}