我试图在我的 UISplitViewController 的细节 View 上设置一个阴影,我希望在 iOS 6 中的主 View 上可见。
在我的细节 View Controller 中:
self.view.layer.shadowColor = [[UIColor blackColor] CGColor];
self.view.layer.shadowOffset = CGSizeMake(-3.0f, 0.0f);
self.view.layer.shadowRadius = 3.0f;
self.view.layer.shadowOpacity = 1.0f;
self.view.layer.masksToBounds = NO;
self.view.clipsToBounds = NO;
但是,即使我在上面的代码中将其设置为 NO,SplitVC 也会自动剪辑其 subview ,并且没有阴影。
任何人都可以让我知道实现这一目标的正确方法吗?
最佳答案
我发现这样做的最好方法是向主 View Controller 添加一个 1px View ,并将其对齐到右边缘,然后将阴影应用于该 View 。
关于ios6 - UISplitViewController 细节 View 投影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12933756/