TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

Long Text in HStack not using maximum width space

Forums > SwiftUI

The following text on the small screens such as the iPhone SE, does not use the maximum available width. The words 'Wednesday Thursday' all go onto the next line when 'Wednesday' can clearly fit on the same line

  HStack {
            Image(systemName: "globe")
                .resizable()
                .foregroundColor(.accentColor)
                .scaledToFit()
                .frame(width: 50, height: 50)
            Text("Yesterday, the best most Wednesday Thursday")
                .frame(maxWidth: .infinity, alignment: .leading)
        }
        .padding(.horizontal, 10)

2      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.