【发布时间】:2015-09-08 17:28:21
【问题描述】:
尝试按照here 概述的方法向我的 UINavigationController 添加阴影。但是,该方法似乎不起作用。
这是我正在使用的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
// ..... etc. ....
self.navigationController.view.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.navigationController.view.bounds cornerRadius:self.navigationController.view.layer.cornerRadius].CGPath;
[self.navigationController.view.layer setMasksToBounds: NO];
[self.navigationController.view.layer setShadowColor: [UIColor blackColor].CGColor];
[self.navigationController.view.layer setShadowOffset: CGSizeMake(0, 1)];
[self.navigationController.view.layer setShadowRadius:3];
[self.navigationController.view.layer setShadowRadius: 4.0];
[self.navigationController.view.layer setShadowOpacity: 0.25];
没有阴影 :((见照片)。
任何想法为什么?感谢您的任何意见。
【问题讨论】:
-
在界面生成器中,也许您可能想尝试将 mapView 移到层次结构的较低位置。
-
检查我的答案@Nick B
标签: ios xcode uinavigationcontroller uinavigationbar