Skip to content

Instantly share code, notes, and snippets.

@dkudelko
Created March 21, 2016 08:25
Show Gist options
  • Save dkudelko/42f2d5bc1c8b3aba1d3d to your computer and use it in GitHub Desktop.
Save dkudelko/42f2d5bc1c8b3aba1d3d to your computer and use it in GitHub Desktop.
remove a default bottom line on android entry Xamarin.Forms
using Mobile.Droid.Renderers;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportRenderer(typeof(Entry), typeof(CustomEntryRenderer_Droid))]
namespace Mobile.Droid.Renderers
{
public class CustomEntryRenderer_Droid : EntryRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
Control?.SetBackgroundColor(Android.Graphics.Color.Transparent);
}
}
}
@kien380
Copy link

kien380 commented Mar 13, 2017

It works! Thank you so much for saving my time :)

@michaelrinderle
Copy link

Right on! Thanks, bro!

@kizzonia
Copy link

kizzonia commented May 9, 2017

am a bit confused am new shuld that go into the app.cs or should i make a new item

@cellecgamesllp
Copy link

Thank You!!!! It worked
nicely

@alecmontgomery
Copy link

thanks it works!!!

@DamonWick
Copy link

thanks it worked

@rk2022
Copy link

rk2022 commented Oct 3, 2017

Thank you so much, It worked, but it applies to all entries, is there a way to apply this on just some entries? I want one of my entries to have the bottom line

@umairali612
Copy link

Control.SetBackgroundColor(global::Android.Graphics.Color.Transparent); Had to use global::. Why is that?

@thisisfatih
Copy link

You are just GREAT!

@TomSoderling
Copy link

@rk2022 Try creating an effect with this Android implementation, then apply it to only the Entry views you want

@patrykolinho
Copy link

Thanks :)

@RanderThe
Copy link

this remove placeholder text ?

@Mitke2011
Copy link

This is pure gold! Thanks!

@MugundhanSaravanan
Copy link

this remove placeholder text ?

yes,,set the placeholder color and background color (in native) as same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment