How do I prevent my text from being automatically displayed on two lines, instead of fill out the first line to the end, first. Is this a bug? Any suggestions greatly appreciated.
Expecting solution:
This is what I get:
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
HStack(spacing: 18) {
VStack {
Text("Need to add a complete sentence.")
.font(.subheadline)
.frame(maxWidth: .infinity, alignment: .leading)
}
.frame(minWidth: 0, maxWidth: .infinity)
.background(Color.green)
VStack {
Text("Need to add a complete sentence.")
.font(.subheadline)
}
.frame(minWidth: 0, maxWidth: .infinity, alignment: .leading)
.background(Color.gray)
}
.frame(minWidth: 0, maxWidth: .infinity)
.background(Color.yellow)
.padding()
}.edgesIgnoringSafeArea(.all)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}