最近,android为Text Input Layout引入了一个新的Exposed下拉菜单。
我正在尝试将其添加到XML中,但找不到它。
我正在使用最新的材料设计版本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,我仍然找不到新的“暴露下拉菜单”。
有人可以指导我如何在我的应用程序中获取它。
像这样在style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox.ExposedDropdownMenu"
中使用TextInputLayout
:
<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>