美文网首页
iOS UINaviGationController - 设置导

iOS UINaviGationController - 设置导

作者: 本客 | 来源:发表于2019-07-10 14:18 被阅读0次

当今很多的APP中为了画面的美观,都做了一些简单的特效,比如说导航栏就躺枪了,其实给导航栏设置阴影的效果很简单,废话不说,上代码:

//1.设置阴影颜色

self.navigationController.navigationBar.layer.shadowColor = [UIColor blackColor].CGColor;

//2.设置阴影偏移范围

self.navigationController.navigationBar.layer.shadowOffset = CGSizeMake(0, 10);

//3.设置阴影颜色的透明度

self.navigationController.navigationBar.layer.shadowOpacity = 0.2;

//4.设置阴影半径

self.navigationController.navigationBar.layer.shadowRadius = 16;

//5.设置阴影路径

self.navigationController.navigationBar.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.navigationController.navigationBar.bounds].CGPath;

通过设置1.2.3步导航阴影就可以出现,如果对阴影有特别的需要,可再设置4.5这两个步骤.

相关文章

网友评论

      本文标题:iOS UINaviGationController - 设置导

      本文链接:https://www.haomeiwen.com/subject/oshhkctx.html