Android:
if (Control != null)
{
GradientDrawable gd = new GradientDrawable();
gd.SetColor(Android.Graphics.Color.White);
gd.SetCornerRadius(12);
gd.SetStroke(2, Android.Graphics.Color.LightGray);
this.Control.SetBackgroundDrawable(gd);
}
iOS:
if (Control != null)
{
if (e.NewElement != null)
e.NewElement.SizeChanged += (obj, args) =>
{
var borderLayer = new CALayer();
borderLayer.Frame = new CoreGraphics.CGRect(0, 0, this.Control.Frame.Width, this.Control.Frame.Height);
borderLayer.BackgroundColor = UIColor.Clear.CGColor;
borderLayer.BorderColor = UIColor.Gray.CGColor;
borderLayer.BorderWidth = 2;
borderLayer.CornerRadius = 10;
this.Control.TextField.BorderStyle = UITextBorderStyle.None;
this.Control.Layer.AddSublayer(borderLayer);
};
} |