我想要创建这样的布局:

我想在TextInputLayout中添加一个旋转器,并像下面这样显示TextInputEditText的提示。
我尝试过定制TextInputLayout,但仍然无法在其中添加一个旋转器。
我添加了这样的TextInputLayout和概述的观点:-
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:textColorHint="@color/colorGreyView"
android:textSize="20dp"
style="@style/Widget.MaterialComponents.Button.OutlinedButton">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Mobile Number"/>
</com.google.android.material.textfield.TextInputLayout>发布于 2019-07-16 11:15:27
实现
'com.google.android.material:material:1.1.0-alpha08'
将TextInputLayout ExposedDropdownMenu与EditextText一起使用,并尝试如下:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Label"
app:errorEnabled="true">
<AutoCompleteTextView
android:id="@+id/filled_exposed_dropdown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:editable="false" />
<com.google.android.material.textfield.TextInputEditText
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</com.google.android.material.textfield.TextInputLayout>根据需要调整宽度大小。
https://stackoverflow.com/questions/57054736
复制相似问题