Step by Step procedure to change the TextView Colour dynamically;
1. Place the Text view into Layout Xml file like below;
1. Place the Text view into Layout Xml file like below;
<TextView
android:id="@+id/txtAlphabat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/imgvAlpha"
android:layout_toRightOf="@+id/imgvAlpha"
android:text=" - Apple"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#c4de66"
android:textSize="26sp"
android:textStyle="bold" />
2. Create object of it into Java file;
private TextView txtAlphabat;
txtAlphabat = (TextView)
findViewById(R.id.txtAlphabat);
3. Assign the color to the textView
txtAlphabat.setTextColor(Color.parseColor("#A82E25"));
No comments:
Post a Comment