【发布时间】:2020-06-17 00:58:30
【问题描述】:
我正在使用以下代码使用 SwiftUI 在屏幕上显示大量数字:
return GeometryReader() { geometry in
Text(series.split(separator: ",")[self.calculator.pointsIndex])
.font(Font.system(size: round(geometry.size.height * 1.5),
weight: .light,
design: .rounded))
.minimumScaleFactor(0.2)
.scaledToFit()
.allowsTightening(true)
.background(Color.red.opacity(0.25))
}
在模拟器上是这样的:
在设备上看起来像这样:
我一直在绞尽脑汁想弄清楚为什么设备上的数字要小得多。有什么想法吗?
【问题讨论】:
标签: swiftui