iOS設置導航欄透明

CGRect frame = self.navigationBar.frame; alphaView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height+20)]; alphaView.backgroundColor = [UIColor blueColor]; [self.view insertSubview:alphaView belowSubview:self.navigationBar]; [self.navigationBar setBackgroundImage:[UIImage imageNamed:@"bigShadow.png"] forBarMetrics:UIBarMetricsCompact]; self.navigationBar.layer.masksToBounds = YES; //寫個方法封裝調用便可 圖片可隨意設置
相關文章
相關標籤/搜索