首页 > 其他 > 详细

使用系统导航栏,设置成全透明的方法

时间:2016-01-19 13:57:09      阅读:133      评论:0      收藏:0      [点我收藏+]

1、先设置系统导航卡全透明   

self.navigationController.navigationBar.translucent  = YES;

        self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor],NSFontAttributeName :[UIFont boldSystemFontOfSize:20]};

2、给系统导航栏添加一张全透明的图,nav就是一张全透明的背景图,UIBarMetricsDefault一定要设置成这个模式

        [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav"] forBarMetrics:UIBarMetricsDefault];

        self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;

3、以上设置可以实现效果,但是有一个缺陷就是,导航栏下方会有1像素的白线,加上这句话就可以了

        self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];

使用系统导航栏,设置成全透明的方法

原文:http://www.cnblogs.com/angongIT/p/5141801.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!