Skip to content

Instantly share code, notes, and snippets.

@nurcinozer
Last active July 30, 2019 12:00
Show Gist options
  • Save nurcinozer/aa1bca8cae58b05ed6d7984b350dba5d to your computer and use it in GitHub Desktop.
Save nurcinozer/aa1bca8cae58b05ed6d7984b350dba5d to your computer and use it in GitHub Desktop.
using Proje.CustomControls;
using Proje.Droid.CustomRenderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(CustomSearchBar), typeof(CustomSearchBarRenderer))]
namespace Proje.Droid.CustomRenderers
{
public class CustomSearchBarRenderer : SearchBarRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
{
base.OnElementChanged(e);
if (Control != null)
{
var plateId = Resources.GetIdentifier("android:id/search_plate", null, null);
var plate = Control.FindViewById(plateId);
plate.SetBackgroundColor(Android.Graphics.Color.Transparent);
//this.Control.SetBackgroundColor(Android.Graphics.Color.Argb(0, 0, 0, 0));
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment