gpt4 book ai didi

ios - AsyncDisplayKit ASButtonNode 如何设置 buttonType

转载 作者:行者123 更新时间:2023-11-28 12:20:31 24 4
gpt4 key购买 nike

我想获得一个与 UIButton(类型:.system)相同的按钮节点。如何设置

最佳答案

    let buttonNode = ASDisplayNode { () -> UIButton in
let button = UIButton(type: .system)
button.backgroundColor = UIColor.white
button.cornerRadius = 4
button.setTitleColor(UIColor.red, for: .normal)
button.titleLabel?.font = UIFont.systemFont(ofSize: 17)
return button
}

if let button = buttonNode.view as? UIButton {
button.setTitle("qqq", for: .normal)
button.addTarget(self, action: #selector(tapAction), for: .touchUpInside)
}

关于ios - AsyncDisplayKit ASButtonNode 如何设置 buttonType,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44961708/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com