Post

Replies

Boosts

Views

Activity

SwiftUI .minimumScaleFactor() shrinks text too soon
I use .minimumScaleFactor() in this simple example and it is not behaving as expected. Can someone explain why the text is scaled so small although having enough room to make it larger? @available(iOS 14.0, *) struct SwiftUIDynamicFontTest: View { var body: some View { VStack { Text("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ") .minimumScaleFactor(0.5) .background(Color.green) Text("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ") .minimumScaleFactor(0.5) .background(Color.green) Text("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ") .minimumScaleFactor(0.5) .background(Color.green) } .frame(height: 390) .background(Color.blue) } } @available(iOS 14.0, *) struct SwiftUIDynamicFontTest_Previews: PreviewProvider { static var previews: some View { SwiftUIDynamicFontTest() } }
0
0
424
Sep ’22