【问题标题】:Comicmind Material Framework button event handlerComicmind 材质框架按钮事件处理程序
【发布时间】:2017-01-22 13:44:57
【问题描述】:

我想问一下,如何使用 cosmicmind/Material 处理 Material Button 的事件?我目前有这个代码。现在,我想在用户点击或单击按钮时执行一项功能。谢谢!

fileprivate func prepareRaisedButton() {
        let button = RaisedButton(title: "Create an account", titleColor : .white)
        button.pulseColor = .white
        button.backgroundColor = Color.teal.base

        view.layout(button)
            .height(ButtonLayout.Raised.height)
            .top(18 * constant).horizontally(left : constant, right : constant)
    }

【问题讨论】:

    标签: ios cosmicmind


    【解决方案1】:

    你要的方法继承自UIControl

    button.addTarget(self, action: #selector(tapButton), for: .touchUpInside)
    

    【讨论】:

    • 还有一件事,我怎样才能得到文本字段的值? email.text 不工作
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-15
    相关资源
    最近更新 更多