我在SwiftEntryKit弹出窗口中添加了 2 个按钮,但在按下按钮后无法弄清楚如何执行某些操作。
我遵循他们的警报示例设置的模式。
我尝试在解雇操作中输入一些内容,但没有用:
// Ok Button
let okButtonLabelStyle = EKProperty.LabelStyle(font: buttonFont, color: buttonColor)
let okButtonLabel = EKProperty.LabelContent(text: "OK, ACCEPT", style: okButtonLabelStyle)
let okButton = EKProperty.ButtonContent(label: okButtonLabel, backgroundColor: .clear, highlightedBackgroundColor: buttonColor.withAlphaComponent(0.05)) {
SwiftEntryKit.dismiss {
print("okButton")
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢你。
你必须设置entryInteraction
到.absorbTouches
的attributes
财产SwiftEntryKit.display
。
var attributes = EKAttributes()
attributes.entryInteraction = .absorbTouches
[...]
SwiftEntryKit.display(entry: <entry variable>, using: attributes)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
566 次 |
最近记录: |