swift - 在 SwiftEntryKit 中按下条目按钮后执行操作
问题描述
我在我的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")
}
}
谢谢你。
解决方案
您必须为 的属性设置entryInteraction
为。.absorbTouches
attributes
SwiftEntryKit.display
var attributes = EKAttributes()
attributes.entryInteraction = .absorbTouches
[...]
SwiftEntryKit.display(entry: <entry variable>, using: attributes)
推荐阅读
- ionic-v1 - 通过 Appflow 部署更新时是否有事件?
- python - 关于格式化 DataFrame 以与 matplotlib 一起使用的问题
- r - 谁为 R 函数输入中的 T/F 实例定义值
- tensorflow - 返回通过边界框阈值的坐标谷歌的对象检测 API
- php - Mysql 将 PHP 变量保存到表中
- python - 融化熊猫df,其中变量名是该单元格的(行名+列名)
- java - Digital Ocean 开放端口 8080 用于 Spring Boot 应用
- r - 导出 R 列表值
- typescript - d3 v5 scaleThreshold 不接受范围内的字符串颜色数组?
- amazon-web-services - 如何配置 S3 端点以防止访问当前区域之外的存储桶