学习笔记-NavigationBar透明
作者:
Mystical | 来源:发表于
2017-06-15 10:11 被阅读20次 self.navigationController.navigationBar.translucent = YES;
UIColor *color = [UIColor clearColor];
CGRect rect = CGRectMake(0, 0, ScreenWidth, 64);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self.navigationController.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.clipsToBounds = YES;
本文标题:学习笔记-NavigationBar透明
本文链接:https://www.haomeiwen.com/subject/bfcrnttx.html
网友评论