android:textColor
doesn't seem to work for TextView
inside a nested LinearLayout
. I had a look at the question at Textcolor selector not working. But it is also not working in my case. Following is my layout file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:orientation="vertical"
tools:context=".CreateActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="15dp">
<TextView
android:id="@+id/lblTitle"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_weight="0.9"
android:hint="Title:"
android:textAlignment="textEnd"
android:textSize="24sp"
android:textColor="#000000"/>
<EditText
android:id="@+id/lblTitleEdit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:hint="Enter your title here"
android:layout_weight="0.4"
android:inputType="text"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="15dp">
<TextView
android:id="@+id/lblVenue"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_weight="0.9"
android:hint="Venue:"
android:textAlignment="textEnd"
android:textSize="24sp"
android:textColor="#000000"/>
<EditText
android:id="@+id/lblVenueEdit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginLeft="10dp"
android:hint="Enter your venue here"
android:layout_weight="0.4"
android:inputType="text"/>
</LinearLayout>
</LinearLayout>
Am I making any mistake here? Any help would be greatly appreciated.
You used hint as text here. So you have to apply color to your hint with the following code. or you can also change hint to text in your xml
.
android:textColorHint="#000"