代码之家  ›  专栏  ›  技术社区  ›  Nishant Pathania

如何更改EditingStyle按钮相对于tableVIew单元格的高度

  •  0
  • Nishant Pathania  · 技术社区  · 7 年前

    我正在使用TableView,并以编辑方式滑动单元格。删除,但单元格大小已根据应用程序的要求定制。删除按钮的高度稍微大一点,我们如何定制它。

    请查看屏幕截图:

    enter image description here

    1 回复  |  直到 7 年前
        1
  •  1
  •   balkaran singh    7 年前

    @艾弗里德夫 用swift更新我的代码你可以试试

    class CustomTableViewCell: UITableViewCell {
    
        override func didTransition(to state: UITableViewCellStateMask) {
                super.willTransition(to: state)
                if state == .showingDeleteConfirmationMask {
                    let deleteButton: UIView? = subviews.first(where: { (aView) -> Bool in
                        return String(describing: aView).contains("Delete")
    
                    })
                    if deleteButton != nil {
                        deleteButton?.frame.size.height = 50.0
                    }
                }
            }
    }
    
    推荐文章