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

97
Vistas
Se agregó un misterioso espacio no deseado en la vista Texto

Es más sencillo simplemente leer el código y ver el resultado final en la imagen. Mi pregunta es ¿por qué la fuerza de actuación y la fuerza de fondo no están alineadas con las vistas de texto que se encuentran sobre ellas? En la vista de texto de Actuation Force , parece haber un relleno misterioso agregado a su izquierda, mientras que Bottom-out Force no lo tiene.

ingrese la descripción de la imagen aquí

 VStack { VStack { HStack { VStack(alignment: .leading, spacing: 5) { Text("**Pre-travel Distance**") Text("how far down the key must be pressed for it to actuate") } .frame(width: 250) .background(.red) SwitchPropertyCircularView(upperBoundValue: theSwitch.preTravelDistance!, unit: "mm") } .background(.blue) HStack { VStack(alignment: .leading, spacing: 5) { Text("**Total Travel Distance**") Text("how far down the key must be pressed for it to bottom out") } .frame(width: 250) .background(.red) SwitchPropertyCircularView(upperBoundValue: theSwitch.totalTravelDistance!, unit: "mm") } .background(.blue) } .frame(width: 380) .background(Color.gray) VStack { HStack { VStack(alignment: .leading, spacing: 5) { Text("**Actuation Force**") Text("the force needed to register a keypress") } .frame(width: 250) .background(.red) SwitchPropertyCircularView(upperBoundValue: Double(theSwitch.actuationForce!), unit: "gf") } .background(.blue) HStack { VStack(alignment: .leading, spacing: 5) { Text("**Bottom-out Force**") Text("the force needed for a switch to bottom out") } .frame(width: 250) .background(.red) SwitchPropertyCircularView(upperBoundValue: Double(theSwitch.bottomOutForce!), unit: "gf") } .background(.blue) } .frame(width: 380) .background(Color.gray) }
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

En "Fuerza de fondo", parece que la primera línea es lo suficientemente ancha antes de envolver palabras que empuja el ancho del Text al ancho máximo de la vista. En los demás, se envuelve con longitudes de línea más cortas y luego termina agregando relleno para centrar el texto dentro de la vista.

Puede solucionar esto agregando una alineación VStack .leading Por ejemplo:

 VStack(alignment: .leading, spacing: 5) { Text("**Actuation Force**") Text("the force needed to register a keypress") } .frame(width: 250, alignment: .leading) //<-- Here

Repita para cada VStack que comparte las mismas cualidades.

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