Java 如何在Android材质设计中删除TextInputLayout下的下划线?
我试图从名为Java 如何在Android材质设计中删除TextInputLayout下的下划线?,java,android,kotlin,material-design,Java,Android,Kotlin,Material Design,我试图从名为TextInputLayout的材质设计组件中删除下划线。我尝试了几个不同的答案,但都不适合我,所以我决定问自己的问题 如何删除此下划线? XML: 如材料设计指南所述,这是TextInputLayout的激活指示器 查看详细信息 一种解决方案是覆盖应用程序中的某些属性 或者你可以这样做: <com.google.android.material.textfield.TextInputLayout android:layout_width="
TextInputLayout
的材质设计组件中删除下划线。我尝试了几个不同的答案,但都不适合我,所以我决定问自己的问题
如何删除此下划线?
XML:
如材料设计指南所述,这是TextInputLayout的激活指示器 查看详细信息 一种解决方案是覆盖应用程序中的某些属性 或者你可以这样做:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/_10sdp"
style="?colorOnPrimary"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:startIconContentDescription="Heading"
app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_heading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/ubuntubold"
android:hint="Heading"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
检查
app:boxStrokeWidth=“0dp”
和app:boxStrokeWidthFocused=“0dp”
如材料设计指南所述,这是文本输入布局的激活指示器
查看详细信息
一种解决方案是覆盖应用程序中的某些属性
或者你可以这样做:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/_10sdp"
style="?colorOnPrimary"
app:boxCornerRadiusTopEnd="@dimen/_5sdp"
app:boxCornerRadiusTopStart="@dimen/_5sdp"
app:startIconContentDescription="Heading"
app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/input_heading"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/ubuntubold"
android:hint="Heading"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
检查
app:boxStrokeWidth=“0dp”
和app:boxStrokeWidthFocused=“0dp”
您尝试过吗?我刚刚测试了android:background=“@null”对我有效。您可以添加一个您尝试过的答案列表,这样我们就不需要问您尝试过什么。是的,我尝试过。它只是完全删除了背景。我的意思是灰色背景您是否将android:background=“@null”
添加到了我尝试为容器和编辑文本添加的。xml也发生了同样的事情,所以我可以测试它。你试过了吗?我刚刚测试了android:background=“@null”
对我有效。您可以添加一个您尝试过的答案列表,这样我们就不需要问您尝试过什么。是的,我尝试过。它只是完全删除了背景。我的意思是灰色背景您是否将android:background=“@null”
添加到了我尝试为容器和编辑文本添加的。xml也发生了同样的事情,所以我可以测试它。非常感谢!这解决了我的问题。顺便问一下,您是否可以提供指向该部分文档的链接?您必须手动查找文本“激活指示器属性”。没有找到这部分的锚。非常感谢!这解决了我的问题。顺便问一下,您是否可以提供指向该部分文档的链接?您必须手动查找文本“激活指示器属性”。没有找到这部分的锚。