如何解决SwiftUI扩展以在Alert中显示图像
在SwiftUI中,标准警报具有以下操作:
public struct Alert {
/// Creates an alert with one button.
public init(title: Text,message: Text? = nil,dismissButton: Alert.Button? = nil)
/// Creates an alert with two buttons.
/// The system determines the visual ordering of the buttons.
public init(title: Text,primaryButton: Alert.Button,secondaryButton: Alert.Button)
}
是否可以为此警报编写扩展名,从而使我可以在标题和消息之间添加图像,所以可以这样使用它:
警报(标题:“标题”,图像:“ image.png”,消息:“消息文本”,dismissButton:Alert.Button)
还是我必须为此创建自己的AlertController?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。