Проблема с цветом пузырьков TextInputEditText

у меня проблема с TextInputEditText, я хочу изменить цвет пузырька.
TextInputEditText
XML-файл макета:

<com.google.android.material.textfield.TextInputLayout
        style="@style/Widget.MyTheme.TextInputLayout.OutlinedBox"
        android:id="@+id/textInputLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="50dp"
        android:layout_marginTop="50dp"
        android:layout_marginEnd="50dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textViewLogin">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="Email"
            android:inputType="textEmailAddress"
            android:textColorHint="@color/white" />
    </com.google.android.material.textfield.TextInputLayout>

Мой стиль:

<style name="Widget.MyTheme.TextInputLayout.OutlinedBox" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
    <item name="boxStrokeColor">@color/white</item>
    <item name="hintTextColor">@color/white</item>
</style>

здесь я попытался добавить

 <item name="colorControlActivated">@color/white</item>
    <item name="android:colorControlActivated">@color/white</item>
    <item name="android:colorAccent">@color/white</item>
    <item name="colorAccent">@color/white</item>

но ни один из них не работал.


person ldim    schedule 14.05.2020    source источник
comment
stackoverflow .com/questions/54487356/   -  person Mohammed Alaa    schedule 14.05.2020
comment
я пробовал но все равно не работает   -  person ldim    schedule 14.05.2020


Ответы (1)


попробуй этот образец

<com.google.android.material.textfield.TextInputLayout
    ..
    android:id="@+id/textInputLayout"
    android:theme="@style/TextInputLayoutAppearance" // add this line
    ..
   >

    <com.google.android.material.textfield.TextInputEditText
       ...
         android:id="@+id/email"
       ..
    />
</com.google.android.material.textfield.TextInputLayout>

в styles.xml

 <style name="TextInputLayoutAppearance" parent="Widget.Design.TextInputLayout">
    <item name="colorControlActivated">@color/blue</item>
</style>

также проверьте эту разницу между стилем и тема

person Mohammed Alaa    schedule 14.05.2020