Кнопка удаления не отображается на UITableViewCell с закругленными углами
В моем табличном представлении у меня есть логика в моей tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath)
чтобы определить, имеет ли ячейка закругленные углы сверху, снизу или вообще не закругленные углы.
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { if indexPath.row == 0 { // round top 2 corners let maskLayer = CAShapeLayer() maskLayer.path = UIBezierPath(roundedRect: cell.bounds, byRoundingCorners: [UIRectCorner .TopLeft, UIRectCorner .TopRight], cornerRadii: CGSizeMake(4, 4)).CGPath cell.layer.mask = maskLayer } if indexPath.section != 1 { if indexPath.row == self.tableView.numberOfRowsInSection(indexPath.section) - 1 { let maskLayer = CAShapeLayer() maskLayer.path = UIBezierPath(roundedRect: cell.bounds, byRoundingCorners: [UIRectCorner .BottomLeft, UIRectCorner .BottomRight], cornerRadii: CGSizeMake(4, 4)).CGPath cell.layer.mask = maskLayer } } }
Это работает, но после того, как я внедрил редактирование в виде таблицы, с кнопкой удаления появляются странные вещи.
С закругленными углами код:
- UITableView находится под прозрачной навигационной панелью
- Как установить выделение для одного для всех разделов в представлении таблицы в ios, цель c
- Перезагрузка данных UITableView в соответствии со значением ползунка
- UICollectionVIEW внутри UITableViewCell, как получить динамическую высоту с автозапуском
- Динамическая ячейка таблицы
Когда я удаляю закругленные углы:
Это действительно смущает меня, потому что я не уверен, что я делаю неправильно. Может ли кто-нибудь помочь?
- Выделение пользовательского UITableViewCell на Touch-Down
- Как возможно, что высота UITableViewCellContentView отличается от heightForRowAtIndexPath:
- Как реализовать просмотр прокрутки в корзине?
- UITableView с UISearchBar, поскольку заголовок вызывает сбои
- Как мне создать асинхронный загрузчик изображений для моего UITableView, который приоритизирует загрузку в зависимости от местоположения в виде таблицы?
- непризнанный селектор с пользовательской ячейкой таблицы
- Слайд UITableViewCell
- Как заставить строку UITableView динамически расти с измененным пользователем контентом
override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { if indexPath.row == 0 { // round top 2 corners let maskLayer = CAShapeLayer() maskLayer.path = UIBezierPath(roundedRect: cell.bounds, byRoundingCorners: [UIRectCorner .TopLeft, UIRectCorner .TopRight], cornerRadii: CGSizeMake(4, 4)).CGPath cell.contentView.layer.mask = maskLayer } if indexPath.section != 1 { if indexPath.row == self.tableView.numberOfRowsInSection(indexPath.section) - 1 { let maskLayer = CAShapeLayer() maskLayer.path = UIBezierPath(roundedRect: cell.bounds, byRoundingCorners: [UIRectCorner .BottomLeft, UIRectCorner .BottomRight], cornerRadii: CGSizeMake(4, 4)).CGPath cell.contentView.layer.mask = maskLayer } } }
использовать cell.contentView.layer.mask = maskLayer