【发布时间】:2016-01-18 20:59:04
【问题描述】:
将 layoutMargins 设置为单元格的 contentView 后,我无法设置自定义 UITableViewCell 的圆角半径:
self.contentView.layoutMargins = UIEdgeInsets(margin, margin, margin, margin)
self.contentView.layer.cornerRadius = 4.0 // Will not show, because of the layoutMargins.
对此的任何解决方案将不胜感激。
编辑
【问题讨论】:
-
一些关于你目前拥有的和你想要实现的截图会有所帮助
-
你在哪里添加这些代码行?
-
- 用截图编辑。 - 这些代码行在 UITableViewCell 的子类中。
-
您是否尝试在您的
UITableViewCell的contentView上将clipsToBounds属性设置为YES? -
@AleksanderGrzyb 是的,我做到了,但仍然无法正常工作。
标签: ios swift uitableview layout cornerradius