【问题标题】:Change the background label更改背景标签
【发布时间】:2021-02-13 09:27:51
【问题描述】:

我尝试了多种方法来更改标签上显示的背景颜色,但我无法做到,如您所见,标签的背景是蓝色的,我想将其更改为另一种颜色。

我该怎么做?

代码

 <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/textInputlogInPasword"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="32dp"
        android:layout_marginEnd="16dp"
        android:background="@android:color/transparent"
        app:boxBackgroundColor="@color/white"
        app:errorEnabled="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textInputLogInName">

        <com.google.android.material.textfield.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/TextInputPasword"
            android:inputType="numberDecimal" />
    </com.google.android.material.textfield.TextInputLayout>

【问题讨论】:

    标签: java android xml material-design android-textinputlayout


    【解决方案1】:

    您可以使用android:background="@color/your_colorandroid:backgroundTint="@color/your_color 更改背景颜色。

    【讨论】:

    • 没有工作,我想改变标签的背景(usuario)。
    猜你喜欢
    • 2016-08-20
    • 2012-04-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-14
    相关资源
    最近更新 更多