Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

37
Vistas
horizontalArrangement not working in Jetpack Compose

I have tried applying SpaceBetween, SpaceEvenly and SpaceAround but nothing seems to be working here. My main goal here is to put the iconButton and the text on the start and end of the same row. Please don't refer to me appbar for doing so I just want to know why this is not working and what is the fix?

enter image description here

        Row(
            modifier = Modifier.padding(30.dp),
            horizontalArrangement = Arrangement.SpaceBetween
        ){

            Text(
                "NOTES",
                fontSize = 30.sp,
                fontWeight = FontWeight.Bold,
                color = Color.White
            )

            IconButton(onClick = { /*TODO*/ }) {
                Icon(
                    Icons.Filled.Search,
                    contentDescription = "Search",
                    tint = Color.LightGray
                )

            }

        }
10 months ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Add the modifier fillMaxWidth() in your Row

Row(
    modifier = Modifier.fillMaxWidth(),
    horizontalArrangement = Arrangement.SpaceBetween
){
   //....your content
}

enter image description here

10 months ago · Santiago Trujillo Denunciar

0

In the Row modifier use fillMaxWidth()

Row(
    modifier = Modifier
        .fillMaxWidth()
        .padding(30.dp),
    horizontalArrangement = Arrangement.SpaceBetween
)    
10 months ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos