相关文章推荐
文质彬彬的香槟  ·  JAVA 连接 ORACLE RAC ...·  1 年前    · 
坏坏的饭盒  ·  postgresql ...·  1 年前    · 
冷冷的茄子  ·  Python3+selenium ...·  1 年前    · 

textinputlayout background color android

TextInputLayout 是 Android 框架中的一个组件,它可以用来包装一个文本输入框,并为文本输入框提供错误消息和标签等附加功能。若要设置 TextInputLayout 的背景颜色,可以在布局文件中为 TextInputLayout 设置 android:background 属性,如下所示:

<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="#ff0000">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="Enter your name" />
</android.support.design.widget.TextInputLayout>

设置#ff0000为红色 如果你使用了其他方式如程序进行设置,可以使用TextInputLayout.setBackgroundColor(color)来设置背景颜色。

  •