【发布时间】:2021-12-24 17:10:13
【问题描述】:
我在 VStack 中有 2 个 Text 元素。它们被设置为不同的字体大小。
如何让 2 个 Text 元素的第一个字形完全左对齐?这可能吗?
下面是sn-p的代码:
extension Font {
static let countDownTitle: Font = Font.system(size: 46, weight: .regular, design: .rounded).leading(.tight)
}
struct MyView: View {
var body: some View {
VStack(alignment: .leading) {
Text("Hello!!")
Text("20.49").font(.countDownTitle)
}
}
}
【问题讨论】: