iOS UINavigationController导航条背景透明
生活随笔
收集整理的這篇文章主要介紹了
iOS UINavigationController导航条背景透明
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
//方法一- (void)setCleanNavtion {//自定義背景[self.navigationController.navigationBarsetBackgroundImage:[UIImagenew] forBarMetrics:UIBarMetricsDefault];//消除陰影self.navigationController.navigationBar.shadowImage = [UIImage new];}//方法二- (void)setNavtion {self.navigationController.navigationBar.translucent=YES;UIColor *color=[UIColorclearColor];CGRect rect =CGRectMake(0,0,self.view.frame.size.width,64);UIGraphicsBeginImageContext(rect.size);CGContextRef context =UIGraphicsGetCurrentContext();CGContextSetFillColorWithColor(context, [colorCGColor]);CGContextFillRect(context, rect);UIImage *image =UIGraphicsGetImageFromCurrentImageContext();UIGraphicsEndImageContext();[self.navigationController.navigationBarsetBackgroundImage:imageforBarMetrics:(UIBarMetricsDefault)];self.navigationController.navigationBar.clipsToBounds=YES;}
?
總結
以上是生活随笔為你收集整理的iOS UINavigationController导航条背景透明的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【教程】Spire.PDF教程:C# 添
- 下一篇: 多重免疫层析技术在产碳青霉烯酶肠杆菌科细