Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

264
Vistas
SwiftUI Picker greyed out in a List

Does anyone have a fix for this? I have a Picker in my List that doesn't respond to any user input and is greyed out, but if I move it out of the List and into a VStack it functions normally.

The majority of answers I've found to this question all say that the Picker needs to be in a Form to work (which I don't understand since it works fine in a VStack), or that its a bug in which it only works on a physical device, which I've also tested on and gotten the same result.

I'll provide a screenshot as well as the code I'm using below

Picker in simulator

import SwiftUI
struct SettingsView: View {
    
@Binding var age : Int

var body: some View {
        VStack(alignment: .leading){
                List{  
                        Picker("Your age", selection: $age) {
                                ForEach(1...100, id: \.self) { number in
                                    Text("\(number)")
                                           }
                                }
                    }
        }
}
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You must embed your List inside a NavigationView, so you can actually "navigate" from "Your age" to the list of Ints.

Just add one additional layer, as shown below:

    var body: some View {
        VStack(alignment: .leading){
            NavigationView {   // This is needed to navigate to the ForEach
                List {
                    Picker("Your age", selection: $age) {
                        ForEach(1..<101) { number in
                            Text("\(number)")
                        }
                    }
                }
            }
        }
    }
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda