📜  在 swiftui 中居中文本 - Swift 代码示例

📅  最后修改于: 2022-03-11 15:01:01.752000             🧑  作者: Mango

代码示例1
.multilineTextAlignment(.center)
//From SwiftUI beta 3 forward, you can center a text view with the frame modifier:
Text("Centered")
    .frame(maxWidth: .infinity, alignment: .center)