【发布时间】:2019-05-08 10:35:11
【问题描述】:
我的应用中有一个自定义 UITableViewCell。我在初始化时向单元格添加了一个视图。
class RestaurantCell: ListTableViewCell {
public let stripeView: UIView = UIView()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
addSubview(stripeView)
}
}
现在,当用户触摸应用程序时,灰色突出显示将覆盖我的自定义视图,但不会覆盖 textLabel 或 detailTextLabel。
为了解决这个问题,我尝试在textLabel 或selectedBackgroundView 上方添加stripeView。那并没有解决它。有什么想法吗?
【问题讨论】:
标签: ios swift uitableview cell