我目前正在使用 Material Design TextInputLayout OutlinedBox 如下图所示:
<android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="@+id/myEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Title"
android:inputType="text"/>
</android.support.design.widget.TextInputLayout>
我正在尝试Spinner
在我的 TextInputEditText 下添加一个下拉框,并希望保持相同的样式:OutlinedBox。
我看到 Material Design, Material Design Text Fields似乎支持下拉菜单。如此处所示的区域:
我目前正在使用 Spinner 生成下拉菜单。
<Spinner
style="@style/Widget.AppCompat.Spinner.DropDown"
android:id="@+id/option"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:dropDownWidth="match_parent" />
似乎不可能在 OutlinedBox 设计之后添加下拉菜单。是否有一个库可以让我实现这一点,或者有没有更好的方法在 Material Design 中实现它?