Dominaezzz
11/26/2020, 8:36 PMIconButton
be the same size as the TextField
by making the Row
wrap on the text field and having the IconButton
fill the wrapped space.
Row(Modifier.fillMaxWidth().wrapContentHeight(), Arrangement.spacedBy(8.dp), Alignment.CenterVertically) {
Spacer(Modifier.width(5.dp))
OutlinedTextField(
value = roomFilter,
onValueChange = { roomFilter = it },
modifier = Modifier.weight(1f),
placeholder = { Text("Filter...") },
leadingIcon = { Icon(Icons.Filled.FilterList) }
)
IconButton(onClick = { /* Show public rooms */ }, modifier = Modifier.fillMaxHeight(), enabled = false) {
Icon(Icons.Filled.Explore)
}
Spacer(Modifier.width(5.dp))
}
This is what I've currently got and it makes the Row
fill everything! (Somewhat understandable behaviour).
Can I achieve what I want without pulling out ConstraintLayout
?allan.conda
11/27/2020, 4:11 AMallan.conda
11/27/2020, 4:12 AMHalil Ozercan
11/27/2020, 6:22 AMlayout
modifier to achieve the same effectDominaezzz
11/27/2020, 1:53 PMDominaezzz
11/27/2020, 1:54 PMlayout
modifier, I can get the height of the text field?