Android автозаполнение фона желтого цвета на EditText - PullRequest
0 голосов
/ 16 апреля 2020

Я безуспешно пробовал разные решения, чтобы удалить желтую краску автозаполнения в текстовом поле. Я попробовал 3 различных способа использования:

<item name="android:autofilledHighlight">@android:color/transparent</item>

, пробовал в версии v26, с инструментами: targetApi = "o" и tools: ignore = "NewApi". Также попробовал решение для разработчиков. android для создания прозрачной фигуры.

Это мой стиль:

<style name="editText" parent="Theme.AppCompat">
    <item name="android:autofilledHighlight" tools:ignore="NewApi">@color/transparent</item>
    <item name="colorControlNormal">@color/lightGray</item>
    <item name="colorPrimary">@color/darkGray</item>
    <item name="colorPrimaryDark">@color/lightGray2</item>
    <item name="colorAccent">@color/mainOrange</item>
</style>

это мой EditText:

<com.google.android.material.textfield.TextInputLayout
        android:id="@+id/login_emailinputlayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/editText"
        android:layout_marginStart="55dp"
        android:layout_marginLeft="55dp"
        android:layout_marginTop="55dp"
        android:layout_marginEnd="55dp"
        android:layout_marginRight="55dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/imageView5">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/login_email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:hint="@string/email"
            android:inputType="textEmailAddress"
            android:paddingLeft="10dp"
            android:paddingRight="10dp"
            android:theme="@style/editText"
            android:textCursorDrawable="@drawable/cursor"
            app:backgroundTint="@color/mainOrange" />
    </com.google.android.material.textfield.TextInputLayout>

Это мой gradle:

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.android.volley:volley:1.1.1'
}

Все работает, кроме желтого автозаполнения краски. Любая помощь будет высоко ценится.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...