【发布时间】:2019-04-11 10:32:47
【问题描述】:
我目前正在使用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>
我正在尝试在我的 TextInputEditText 下添加一个下拉框 Spinner,并希望保持相同的样式: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 中实现它?
【问题讨论】:
-
您找到这个问题的答案了吗?我面临同样的问题。如此处所述:stackoverflow.com/questions/54004976/…
-
有人(谷歌)提供了这个视图吗?他们在设计文档中展示它真是太棒了,但完全将实现留在了 sdk 之外。
标签: android material-design android-textinputlayout material-components-android material-components