Puedo poner varias líneas de texto en una sola sección de la lista de SwiftUI?

Jake:

Quiero poner varias líneas de texto en una sección de una lista (antes de que el primer divisor). La cuestión es cualquier texto nuevo añadido obtiene su propia línea nueva.

¿Hay alguna manera para mí para poner varias líneas en una sección de la lista? Aquí está mi código:

struct ChestWorkouts: View {
@State var BPWeight: String = ""
@State var GoalBPWeight: String = ""
var body: some View {
    List{
        Text("Bench Press").fontWeight(.bold)
        TextField("Goal Weight", text: $GoalBPWeight).keyboardType(.numberPad)
        TextField("Weight", text: $BPWeight).keyboardType(.numberPad)

    }.environment(\.defaultMinListRowHeight, 90)
Mac3n:

Puede ponerlos en una VStack

struct ContentView: View {
    @State var BPWeight: String = ""
    @State var GoalBPWeight: String = ""
    var body: some View {
        List{
            VStack {
                Text("Bench Press").fontWeight(.bold)
                TextField("Goal Weight", text: $GoalBPWeight).keyboardType(.numberPad)
                TextField("Weight", text: $BPWeight).keyboardType(.numberPad)
            }
        }.environment(\.defaultMinListRowHeight, 90)
    }
}

Supongo que te gusta

Origin http://10.200.1.11:23101/article/api/json?id=384418&siteId=1
Recomendado
Clasificación