title: Xamarin.Android Change Single EditText Underline Color
body: <p>I am trying to change the holo underline color of a single EditText programmatically. I have tried all the examples I could find on SO, but nothing seems to work. Here is my latest and best attempt:</p>
  
  <p>EDIT: Current code:</p>
  
  <pre><code>txtName.Background.ClearColorFilter();
  txtName.Background.SetColorFilter(Android.Graphics.Color.ParseColor("#ff0000"), PorterDuff.Mode.SrcIn);
  </code></pre>
  
  <p>I have also tried just using <code>txtName.Background.SetTint(Resource.Color.colorRed)</code> but that did not work either.</p>
  
  <p>Here is a picture of the line color I am trying to change:
  <a href="https://i.stack.imgur.com/uZ7WW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uZ7WW.png" alt="enter image description here"></a></p>
  
  <p>EditText XML:</p>
  
  <pre><code>&lt;EditText
          android:id="@+id/input_name"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:inputType="textCapWords"
          android:digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz "
          android:maxLength="30"
          android:singleLine="true"
          android:scrollHorizontally="true"
          android:hint="Name"
          android:textColor="#8c8c8c"
          android:textColorHint="#8c8c8c"
          app:backgroundTint="#22d6d3"
          android:layout_marginBottom="10dp" /&gt;
  </code></pre>
  
  <p><strong>EDIT - Here is the code that ended up working:</strong></p>
  
  <pre><code>ViewCompat.SetBackgroundTintList(txtName, Android.Content.Res.ColorStateList.ValueOf(Color.Red));
  </code></pre>