【问题标题】:WidgetKit - Link with text and imageWidgetKit - 与文本和图像的链接
【发布时间】:2021-10-20 16:24:06
【问题描述】:

我正在尝试创建这样的东西:

这是我目前得到的:

Link(destination: URL(string: "xxxx")!) {
    Text("Lock")
        .foregroundColor(Color.white)
        .font(.caption)
        .padding(EdgeInsets(top: 10, leading: 10, bottom: 10, trailing: 10))
        .background(Color.gray)
        .cornerRadius(15)
}

我的头像:

但是如何在其中添加锁定图像?

【问题讨论】:

    标签: ios swift xcode swiftui widgetkit


    【解决方案1】:

    您可以使用系统映像

        HStack(spacing: 4){
            Image(systemName: "lock.open.fill")
            Text("Lock")
        }.foregroundColor(Color.white)
            .font(.caption)
            .padding(EdgeInsets(top: 10, leading: 10, bottom: 10, trailing: 10))
            .background(Color.gray)
            .cornerRadius(15)
    

    【讨论】:

      猜你喜欢
      • 2012-08-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-06
      • 2012-10-31
      • 2021-06-11
      • 1970-01-01
      • 2011-02-18
      • 1970-01-01
      相关资源
      最近更新 更多