Android TextInputLayout 公开下拉菜单
Android TextInputLayout Exposed Dropdown Menu
最近,android 为文本输入布局引入了一个新的公开下拉菜单。
我正在尝试将它添加到我的 XML 但找不到它。
我正在使用最新的 material 设计版本 1.2.0-alpha05。
我的风格也是使用 Material 组件,如下所示:
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionOverflowButtonStyle">@style/actionButtonOverflow</item>
</style>
但是,我仍然找不到 Material.io 的新的 Exposed Drop Down 菜单。
有人可以指导我如何在我的应用程序中获取它。
像这样在 TextInputLayout
中使用 style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
:
<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">
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
最近,android 为文本输入布局引入了一个新的公开下拉菜单。
我正在尝试将它添加到我的 XML 但找不到它。
我正在使用最新的 material 设计版本 1.2.0-alpha05。
我的风格也是使用 Material 组件,如下所示:
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionOverflowButtonStyle">@style/actionButtonOverflow</item>
</style>
但是,我仍然找不到 Material.io 的新的 Exposed Drop Down 菜单。
有人可以指导我如何在我的应用程序中获取它。
像这样在 TextInputLayout
中使用 style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
:
<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">
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>