title: How to change searchbar cancel button image in xamarin forms
body: <p>I have used custom renderer to change the search bar underline color. But i don't know how to change the cancel button cross symbol(X) to image as shown in the attached screenshot. My custom renderer is as below,</p>
  
  <pre><code> public class CustomSearchBarRenderer : SearchBarRenderer
      {
          protected override void OnElementChanged(ElementChangedEventArgs&lt;SearchBar&gt; e)
          {
              base.OnElementChanged(e);
  
              if (e.OldElement == null)
              {
                  LinearLayout linearLayout = this.Control.GetChildAt(0) as LinearLayout;
                  linearLayout = linearLayout.GetChildAt(2) as LinearLayout;
                  linearLayout = linearLayout.GetChildAt(1) as LinearLayout;
  
                  GradientDrawable gd = new GradientDrawable();
                  gd.SetStroke(0, Android.Graphics.Color.LightGray);
  
                  linearLayout.Background = gd;                 
  
                  AutoCompleteTextView textView = linearLayout.GetChildAt(0) as AutoCompleteTextView;
              }
          }
  
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/d1G30.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/d1G30.png" alt="enter image description here"></a></p>