Cant Resolve Widget.MaterialComponents.TextInputLayout.*.ExposedDropdownMenu
I tried to create a AutoCompleteTextView
, surrounded by a TextInputLayout
. According to the documentation, I should use this style:
Widget.MaterialComponents.TextInputLayout.*.ExposedDropdownMenu
But I can't resolve this style. Android Studio says I can only use:
@style/Widget.MaterialComponents.TextInputLayout.FilledBox.Dense
@style/Widget.MaterialComponents.TextInputLayout.FilledBox
@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense
@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox
My project uses
implementation 'com.android.support:design:28.0.0'
The final result should look like this:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/hint_text">
<AutoCompleteTextView
android:id="@+id/filled_exposed_dropdown"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
Answer
I raised this query in Android Material Components' Github issues.
Based on this response, the public documentation is based not on the current stable release, but on the latest alpha (or beta) release. There is no way to tell from the documentation on material.io about which components are in stable, alpha or beta versions of the library.
Having clarified that, the solution to this issue is to upgrade your support-design library, as suggested by @jeel-vankhede, to:
implementation 'com.google.android.material:material:1.1.0-alpha07'
Related heads up, in case you are also using ViewModels (lib v. 2.0.0):
Upgrading to 1.1.0-alpha of Material design library automatically updates the androidx.lifecycle libraries to 2.1.0+. This update has a breaking change from 2.0.0 which may break your view model code. This change is only observed in minified versions of the app.
Related Questions
- → should I choose reactjs+f7 or f7+vue.js?
- → Phonegap Android write to sd card
- → Local reference jquery script in nanohttpd (Android)
- → Click to navigate on mobile devices
- → How to allow api access to android or ios app only(laravel)?
- → Access the Camera and CameraRoll on Android using React Native?
- → React native change listening port
- → What is the default unit of style in React Native?
- → Google play market autocomplete icon
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → Using Laravel with Genymotion
- → react native using like web-based ajax function
- → react native pdf View