我正在尝试让我的
UITextView
的角被包含它的分组UITableViewCell
的圆角所遮蔽。下面是当前单元格的截图。
cell.contentView.layer.masksToBounds = YES;
cell.layer.masksToBounds = YES; //tried this as a test, still doesn't work
detailTextView.clipsToBounds = YES;
[cell.contentView addSubview:detailTextView];
并且
cell.layer.masksToBounds = YES;
cell.contentView.layer.masksToBounds = YES;
detailTextView.clipsToBounds = YES;
[cell addSubview:detailTextView];
这显然不起作用,我错过了什么?
cell.clipsToBounds = YES;
吗? - Patrick剪辑子视图
,但我不确定如何在代码中实现。 - Patrickcell.contentView.clipsToBounds = YES;
吗?我猜你已经试过了,但是我在代码中没有看到它。你可能需要基于cell.backgroundView
创建一个遮罩层。不过要小心这种方法,因为它可能会降低你的帧率,特别是在滚动时。 - Mike