我有带有背景图案的自定义 UITableViewCell
使用这种方法
- (void)tableView:(UITableView *)tableView willDisplayCell:(homeCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"background.png"]];
}
结果很好,
图片链接:链接
但是当我滑动删除时,删除按钮带有覆盖单元格内容的背景颜色
图片链接:链接
我遵循了我在stackoverflow中找到的一些解决方案,但没有一个解决我的问题
我尝试使用此代码清除删除按钮的背景颜色
- (void)tableView:(UITableView *)tableView willDisplayCell:(homeCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
// create uiview
UIView* myBackgroundView = [[UIView alloc] initWithFrame:CGRectZero];
myBackgroundView.backgroundColor = [UIColor clearColor];
// assign the uiview
cell.editingAccessoryView = myBackgroundView;
cell.backgroundView = myBackgroundView;
// my background patter
cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"CellBG.png"]];
}
但是效果不好,整个单元格背景都是没有背景色的
图片链接:链接
如何显示没有背景颜色的删除按钮?请帮忙
我尝试过的一些解决方案: 链接1