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);
};
} |
protected override void OnElementChanged(ElementChangedEventArgs<SfAutoComplete> e) { base.OnElementChanged(e); if (Control != null) { //Control.Background = Context.GetDrawable(Resource.Drawable.rounded_corners); GradientDrawable gd = new GradientDrawable(); gd.SetShape(ShapeType.Rectangle); gd.SetColor(Android.Graphics.Color.Transparent); gd.SetCornerRadius(15); gd.SetStroke(4, Android.Graphics.Color.LightGray); //Control.AutoEditText.SetBackgroundColor(Android.Graphics.Color.Transparent); Control.SetBackgroundDrawable(gd); } }
ShowBorder="False"
|