public class CustomRendereriOS : SfComboBoxRenderer
{
public CustomRendereriOS()
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Syncfusion.XForms.ComboBox.SfComboBox> e)
{
base.OnElementChanged(e);
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 = 0;
this.Control.TextField.BorderStyle = UITextBorderStyle.None;
this.Control.Layer.AddSublayer(borderLayer);
};
}
}
} |
Code Snippet:
Android:
if (Control != null)
{
if (!string.IsNullOrEmpty(Control.Watermark))
{
var editText = Control.GetAutoEditText();
editText.SetPadding(0, 0, 0, 0);
}
}
iOS:
if (Control != null)
{
Control.TextField.LeftView = new UIView(new CGRect(0, 0, 0, 0));
Control.TextField.LeftViewMode = UITextFieldViewMode.Always;
} |