I'm trying to make the `IconButton` be the same si...
# compose
d
I'm trying to make the
IconButton
be the same size as the
TextField
by making the
Row
wrap on the text field and having the
IconButton
fill the wrapped space.
Copy code
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
?
a
what do you mean button being same size as text field?
I’m having difficulty visualizing what you’d like to achieve.
h
You can also use a minimal
layout
modifier to achieve the same effect
d
Sorry, I meant to say the same height.
With the
layout
modifier, I can get the height of the text field?