Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146813 | Aug 21,2019 06:27 AM UTC | Aug 22,2019 12:11 PM UTC | Xamarin.Forms | 5 |
![]() |
Tags: SfAutoComplete |
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"
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.