相关疑难解决方法(0)

26
推荐指数
4
解决办法
3万
查看次数

MaterialComponents.TextInputLayout.OutlinedBox 它不能正常工作 boxBackgroundColor

我用材料。我将为 TextInputLayout 使用一种颜色作为背景,但类似于下面的颜色!提示背景未更改。我使用了样式并想进行更改,但没有奏效。在布局本身中,我尝试再次应用更改!如何解决这个问题?

笔记

图片中标签用户名的背景不透明,它覆盖了一些TextInputEditText

在此处输入图片说明

build.gradle 中

implementation 'com.google.android.material:material:1.1.0'
Run Code Online (Sandbox Code Playgroud)

风格

 <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
        <item name="textAppearanceSubtitle1">@style/TextAppearance.App.Subtitle1</item>
        <item name="textAppearanceCaption">@style/TextAppearance.App.Caption</item>
        <item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.App.SmallComponent</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.MaterialComponents.Dark.ActionBar"/>

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.MaterialComponents.Light"/>


    <style name="TextAppearance.App.Subtitle1" parent="TextAppearance.MaterialComponents.Subtitle1">
        <item name="colorControlActivated">@color/white</item>
        <item name="android:colorControlActivated">@color/white</item>
    </style>

    <style name="TextAppearance.App.Caption" parent="TextAppearance.MaterialComponents.Caption">
        <item name="android:textColorTertiary">@color/white</item>
        <item name="android:textColorTertiaryInverse">@color/white</item>
        <item name="colorControlActivated">@color/white</item>
        <item name="android:colorControlActivated">@color/white</item>
    </style>

    <style …
Run Code Online (Sandbox Code Playgroud)

android material-design android-textinputlayout android-textinputedittext

6
推荐指数
1
解决办法
3214
查看次数