【问题标题】:How to change outline color on TextInputLayout from material component?如何从材质组件更改 TextInputLayout 的轮廓颜色?
【发布时间】:2020-12-15 02:22:04
【问题描述】:

我收到一条错误消息:

错误膨胀类 com.google.android.material.textfield.TextInputLayout

从材料组件实现TextInputLayout 时。 实际上,我已经通过在我的根布局上放置材料主题解决了这个问题

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".LoginActivity"
**android:theme="@style/Theme.MaterialComponents.Light.NoActionBar"**
android:padding="20dp">

但是轮廓颜色和字体变了,我应​​该怎么做才能让轮廓颜色回到我的colorAccent

【问题讨论】:

    标签: java android xml android-studio material-components-android


    【解决方案1】:

    添加这一行:app:boxStrokeColor="?attr/colorAccent"

    【讨论】:

      猜你喜欢
      • 2018-11-21
      • 2020-08-15
      • 2019-11-23
      • 2022-01-01
      • 1970-01-01
      • 2019-02-03
      • 2018-11-07
      • 2019-04-17
      • 1970-01-01
      相关资源
      最近更新 更多