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

170
Vistas
One of Row items is not displayed in Jetpack Compose view

Here's a test composable:

@Preview
@Composable
fun SliderInRow() {
    Row {
        Text("qwe")
        Slider(value = 0f, onValueChange = {})
        Text("wer")
    }
}

I want a row with a text, a slider and another text. However, the last text composable (wer) is missed:

enter image description here

What am I doing wrong?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Slider is designed to take all width available, same as any view with Modifier.fillMaxWidth does.

That's why he compresses the last view and makes it zero width.

The recommended way to create such a layout is to add Modifier.weight(1f) to the flexible view, Slider in you case. From its documentation:

The parent will divide the horizontal space remaining after measuring unweighted child elements and distribute it according to this weight.

Row {
    Text("qwe")
    Slider(value = 0f, onValueChange = {}, modifier = Modifier.weight(1f))
    Text("wer")
}
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