答案 0 :(得分:0)
首先,只需打开故事板,单击按钮一次以选择它,然后通过单击蓝色箭头将阴影颜色设置为默认:
在override func ViewDidLoad()
:
self.buttonOutlet.layer.shadowColor = UIColor.white.cgColor
self.buttonOutlet.layer.shadowOffset = CGSize(width: 0, height: 0)
self.buttonOutlet.layer.shadowRadius = 0
self.buttonOutlet.layer.shadowOpacity = 0
将buttonOutlet
替换为按钮插座的实际名称。
如果有帮助,请告诉我:)。
答案 1 :(得分:0)
我确实解决了这个问题,我们可以自定义这个按钮。 处理TableViewCell。
-(void)layoutIfNeeded {
[super layoutIfNeeded];
if ([self.subviews count] >= 4){
for(UIView* subView in self.subviews){
//DDLogDebug(@"JARED: subView %@",[subView class]);
if([NSStringFromClass([subView class]) isEqualToString:@"UITableViewCellEditControl"]){
for(UIView * subView2 in subView.subviews){
if ([subView2 isKindOfClass: [UIImageView class]] && subView2.frame.origin.y == 20) {
subView2.layer.shadowRadius = 11;
subView2.layer.shadowColor = [UIColor whiteColor].CGColor;
subView2.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
subView2.layer.shadowOpacity = 0.1;
subView2.layer.cornerRadius = 11;
subView2.layer.masksToBounds = NO;
subView2.layer.backgroundColor = [UIColor whiteColor].CGColor;
subView2.layer.contents = (id)[UIImage imageNamed:@"confirmDetele"].CGImage;
}
if ([subView2 isKindOfClass: [UIImageView class]] && subView2.frame.origin.y == 22) {
subView2.layer.contents = nil;
subView2.layer.shadowRadius = 11;
subView2.layer.shadowColor = [UIColor whiteColor].CGColor;
subView2.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
subView2.layer.shadowOpacity = 0.1;
subView2.layer.cornerRadius = 11;
subView2.layer.masksToBounds = NO;
subView2.layer.backgroundColor = [UIColor whiteColor].CGColor;
}
}
}
}
}
}