【发布时间】:2019-09-01 08:28:07
【问题描述】:
在 Swift 中,如 here 所示,您可以使用“NSMutableAttributedString”在文本中嵌入链接。
如何使用 SwiftUI 实现这一点?
我按如下方式实现它,但这看起来不像我想要的那样。 .
import SwiftUI
struct ContentView: View {
var body: some View {
HStack {
Text("By tapping Done, you agree to the ")
Button(action: {}) {
Text("privacy policy")
}
Text(" and ")
Button(action: {}) {
Text("terms of service")
}
Text(" .")
}
}
}
【问题讨论】:
-
SwiftUI 尚不支持任何
Attribute。
标签: swiftui