I am developing an application which has multiple form, but i want some effects on it. What i want to do is changing the color of icon which is placed inside edit text
.
<EditText
android:id="@+id/marks"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignEnd="@+id/button1"
android:layout_alignParentTop="true"
android:layout_marginTop="10dp"
android:drawableRight="@drawable/ic_border"
android:hint="Total Marks"
android:inputType="number"
android:textColor="#fff" />
if you want to change the color you can use this
first change the color of the drawable.
Drawable mDrawable = context.getResources().getDrawable(R.drawable.yourdrawable);
mDrawable.setColorFilter(new
PorterDuffColorFilter(0xffff00,PorterDuff.Mode.MULTIPLY));
now set it to the EditText
edtText.setCompoundDrawablesWithIntrinsicBounds(mDrawable, 0, 0, 0);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With