Ich habe versucht, ändern meine Textunterseite Farbe auf verschiedene Arten, aber es ändert sich nicht. Ich möchte keine Zeichen verwenden.Wie ändert man die untere Linienfarbe von EditText in Android?
hier ist meine XML und die Methoden, die ich versucht habe zu verwenden.
Methode ein:
android:backgroundTint="@color/colorPrimary"
Methode zwei:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorControlNormal">@color/colorPrimary</item>
<item name="colorControlActivated">@color/colorPrimary</item>
<item name="colorControlHighlight">@color/colorPrimary</item>
</style>
</resources>
Hier ist meine xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res /android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/b"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.isaac.loginexamples.b">
<RelativeLayout
android:background="#009688"
android:layout_width="match_parent"
android:layout_height="@dimen/relative_half_screen_height">
</RelativeLayout>
<android.support.v7.widget.CardView
card_view:cardElevation="18dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_width="@dimen/card_view_width"
android:layout_height="@dimen/card_view_height">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/header_logo_two"
android:background="#22313F"
android:layout_width="match_parent"
android:layout_height="@dimen/view_header_height"></View>
<View
android:background="@drawable/shadow"
android:layout_below="@+id/header_logo_two"
android:layout_width="match_parent"
android:layout_height="7dp"></View>
<ImageView
android:layout_marginTop="25dp"
android:layout_centerHorizontal="true"
android:id="@+id/logo_two"
android:background="@mipmap/ic_launcher"
android:layout_width="@dimen/logo_image_width_height"
android:layout_height="@dimen/logo_image_width_height" />
<EditText
android:backgroundTint="@color/colorPrimary"
android:id="@+id/username"
android:layout_marginTop="15dp"
android:layout_centerHorizontal="true"
android:layout_below="@+id/logo_two"
android:layout_width="270dp"
android:layout_height="45dp"
android:inputType="textEmailAddress" />
<EditText
android:layout_marginTop="8dp"
android:layout_alignLeft="@+id/username"
android:layout_below="@+id/username"
android:layout_width="240dp"
android:layout_height="45dp" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
ich diese beiden Methoden versucht haben, die ich online gesehen haben, aber es doesn‘ t arbeiten. Ich verwende die neueste Version von Android Studio. Ich hoffe, es gibt eine Lösung. HINWEIS: Ich möchte keinen Drawable verwenden. Vielen Dank!
Vielleicht sollten Sie die ziehbar xD – Beloo
Ma verwenden Ja, aber weißt du, ich benutze lieber die AppCompat. Ich denke, es ist schöner und zuverlässiger. @Beloo –