[英]How to remove textinputlayout background
我在白色背景上有一个 textinputlayout,但背景看起来是灰色的。我怎样才能删除这个效果
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_marginTop="@dimen/vertical_field_spacing"
android:layout_height="wrap_content"
android:background="@null"
android:layout_gravity="left"
android:orientation="horizontal">
<EditText
android:gravity="left"
android:layout_width="match_parent"
android:inputType="textEmailAddress"
android:layout_height="wrap_content"
android:hint="Email"/>
</com.google.android.material.textfield.TextInputLayout>
您可以通过以下方式将背景设置为透明来移除背景:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_marginTop="@dimen/vertical_field_spacing"
android:layout_height="wrap_content"
app:boxBackgroundColor="@android:color/transparent"
android:background="@android:color/transparent"
android:layout_gravity="left"
android:orientation="horizontal">
<EditText
android:gravity="left"
android:layout_width="match_parent"
android:background="@null"
android:inputType="textEmailAddress"
android:layout_height="wrap_content"
android:hint="Email"/>
</com.google.android.material.textfield.TextInputLayout>
注意这两行:
app:boxBackgroundColor="@android:color/transparent"
android:background="@android:color/transparent"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.