Hi folks, in the 1.1.0-beta03 version of compose m...
# compose
a
Hi folks, in the 1.1.0-beta03 version of compose material library we have added a new ExposedDropdownMenuBox component that is fantastic, but the default design is the filled dropdown menu style, not the outlined one which is what i'm looking for. is there a way to configure it such?
the two styles in question
d
Have you tried to put an
OutlinedTextField
inside your
ExposedDropdownMenuBox
instead of the
TextField
demonstrated in the API docs?
a
a good idea! it basically works except it keeps the darker background colour
d
Could you share a code snippet?
a
yes, i have some findings but my computer's at a standstill thanks to a build 😆
the jist is that you can change the style to outlined successfully simply by replacing the TextField with an OutlinedTextFeild, except when you pass the colours in you should override the background colour to be transparent (or something else), as such
Copy code
OutlinedTextField(
                            readOnly = true,
                            value = selectedOptionText,
                            onValueChange = { },
                            label = { Text("Label") },
                            trailingIcon = {
                                ExposedDropdownMenuDefaults.TrailingIcon(
                                    expanded = expanded
                                )
                            },
                            colors = ExposedDropdownMenuDefaults.textFieldColors(
                                backgroundColor = Color.Transparent
                            )
                        )