-1

我使用 Eureka 表单进行快速项目,并且有一个客户行:

这是我的 Xib:

在此处输入图像描述

这是我的课:

public class CustomServiceCell : Cell<Bool>, CellType{

    @IBOutlet weak var btnDelete: UIButton!
    @IBOutlet weak var lblTitle: UILabel!


    public override func setup() {
        //height = { 60 }
        //lblTitle.text = row.title
        super.setup()
        selectionStyle = .None
        //btnDelete.addTarget(self, action: #selector(onDelete), forControlEvents: .TouchUpInside)

    }

    @IBAction func onDelete(sender: UIButton) {
        print("Delete Button tapped")
        row.value = true

    }

    public override func update() {
        super.update()

    }
}

这就是我将它添加到我的表单的方式:

<<< CustomServiceRow();

我想知道如何传递值来设置按钮文本的名称和标签的文本。

有什么线索吗?

4

1 回答 1

0

来自Eureka在 Github 中的自述文件:

let row  = SwitchRow("SwitchRow") { row in      // initializer
                        row.title = "The title"
                    }.onChange { row in
                        row.title = (row.value ?? false) ? "The title expands when on" : "The title"
                        row.updateCell()
                    }.cellSetup { cell, row in
                        cell.backgroundColor = .lightGrayColor()
                    }.cellUpdate { cell, row in
                        cell.textLabel?.font = .italicSystemFontOfSize(18.0)
                }
于 2016-07-13T21:45:02.183 回答