Saturday, November 26, 2022
HomeiOS Developmentios - SwiftUI .minimumScaleFactor() shrinks textual content too quickly

ios – SwiftUI .minimumScaleFactor() shrinks textual content too quickly


I take advantage of .minimumScaleFactor() on this easy instance and it isn’t behaving as anticipated. Can somebody clarify why the textual content is scaled so small though having sufficient room to make it bigger?

enter image description here

@out there(iOS 14.0, *)
struct SwiftUIDynamicFontTest: View {
    var physique: some View {
  
        VStack {
            Textual content("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ")
                .minimumScaleFactor(0.5)
                .background(Colour.inexperienced)
            Textual content("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ")
                .minimumScaleFactor(0.5)
                .background(Colour.inexperienced)
            Textual content("MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMZ")
                .minimumScaleFactor(0.5)
                .background(Colour.inexperienced)
        }
        .body(peak: 390)
        .background(Colour.blue)
    }
}

@out there(iOS 14.0, *)
struct SwiftUIDynamicFontTest_Previews: PreviewProvider {
    static var previews: some View {
        SwiftUIDynamicFontTest()
    }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments