Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

357
Views
Menú desplegable expuesto para composición jetpack

Me preguntaba si hay una solución para el menú desplegable Expuesto para la composición del jetpack. No pude encontrar una solución adecuada para este componente dentro de la composición del jetpack. ¿Alguna ayuda?

Desplegable

over 4 years ago · Hanz Gallego
1 answers
Answer question

0

Esto es lo que hice para obtener el mismo ancho que el campo de texto: copiar y modificar la respuesta de Gabriele.

 var expanded by remember { mutableStateOf(false) } val suggestions = listOf("Item1","Item2","Item3") var selectedText by remember { mutableStateOf("") } var dropDownWidth by remember { mutableStateOf(0) } val icon = if (expanded) Icons.Filled..... else Icons.Filled.ArrowDropDown Column() { OutlinedTextField( value = selectedText, onValueChange = { selectedText = it }, modifier = Modifier.fillMaxWidth() .onSizeChanged { dropDownWidth = it.width }, label = {Text("Label")}, trailingIcon = { Icon(icon,"contentDescription", Modifier.clickable { expanded = !expanded }) } ) DropdownMenu( expanded = expanded, onDismissRequest = { expanded = false }, modifier = Modifier .width(with(LocalDensity.current){dropDownWidth.toDp()}) ) { suggestions.forEach { label -> DropdownMenuItem(onClick = { selectedText = label }) { Text(text = label) } } } }
over 4 years ago · Hanz Gallego Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!