Untitled
unknown
plain_text
9 months ago
1.4 kB
7
Indexable
Text(text = "Direction", color = Color.Black)
var expanded by remember { mutableStateOf(false) }
Box {
OutlinedTextField(
value = direction,
onValueChange = { direction = it },
readOnly = true,
modifier = Modifier
.fillMaxWidth()
.padding(0.dp)
.clickable { expanded = true },
colors = OutlinedTextFieldDefaults.colors(
focusedContainerColor = Color.Gray,
unfocusedContainerColor = Color.Gray,
disabledContainerColor = Color.Gray,
cursorColor = Color.Black,
focusedBorderColor = Color.Gray,
unfocusedBorderColor = Color.Gray,
focusedLabelColor = Color.Black,
unfocusedLabelColor = Color.Black,
)
)
DropdownMenu(expanded = expanded, onDismissRequest = { expanded = false }
) {
DropdownMenuItem(text = { Text("Right") },
onClick = { direction = "left"; expanded = false })
DropdownMenuItem(text = { Text("Right") },
onClick = { direction = "Right"; expanded = false })
}
}Editor is loading...
Leave a Comment