Iphone 阴影偏移量+;拐角半径表视图

Iphone 阴影偏移量+;拐角半径表视图,iphone,objective-c,uitableview,ios5,Iphone,Objective C,Uitableview,Ios5,我正在尝试将阴影和角半径添加到tableView中。corneradius工作正常,但shadowOffset不工作: CGRect shadowFrame = self.mainTableView.layer.bounds; CGPathRef shadowPath = [UIBezierPath bezierPathWithRect:shadowFrame].CGPath; self.mainTableView.layer.shadowPath = shadowPath; self.main

我正在尝试将阴影和角半径添加到tableView中。
corneradius
工作正常,但
shadowOffset
不工作:

CGRect shadowFrame = self.mainTableView.layer.bounds;
CGPathRef shadowPath = [UIBezierPath bezierPathWithRect:shadowFrame].CGPath;
self.mainTableView.layer.shadowPath = shadowPath;
self.mainTableView.layer.shadowColor = [UIColor blackColor].CGColor;
self.mainTableView.layer.shadowOffset = CGSizeMake(0, 1);
self.mainTableView.layer.shadowOpacity = 4.0;
self.mainTableView.layer.shadowRadius = 7.0;
有什么想法吗?

你试过了吗

self.mainTableView.layer.masksToBounds = NO;

基本上要实现这一点,您需要使用两个视图


查看此链接:

您能给我们一个视图布局的屏幕截图吗?您使用IB吗?如果是,请通过IB进行尝试。@Darwin您不能通过IB设置阴影路径或角半径。@Wayne您可以使用阴影偏移。但显然,这不是一个合理的观点。你说得对。@Darwin这只是因为
UIView
的一些子类公开了它们自己的影子属性<无法在IB中设置代码>CALayer属性。