I've overridden OnElementChanged method inside a custom EntryRenderer which looks like this:
protected override void OnElementChanged(ElementChangedEventArgs<Entry> e)
{
base.OnElementChanged(e);
if (Control != null)
{
var iconLabel = new UILabel();
iconLabel.Font = FontAwesome.Font(12);
iconLabel.Text = " " + FontAwesome.FAPlay;
iconLabel.Frame = new CGRect(x: 5, y: 0, width: 20, height: 20);
Control.LeftView = iconLabel;
Control.LeftViewMode = UITextFieldViewMode.Always;
Control.BorderStyle = UITextBorderStyle.None;
var bottomLine = new CALayer();
bottomLine.Frame = new CGRect(0.0, Control.Frame.Height - 1, Control.Frame.Width, 1.0);
bottomLine.BackgroundColor = UIColor.White.CGColor;
Control.Layer.AddSublayer(bottomLine);
}
}
All I want to do is customize Entry control to add FontAwesome icon on the left and add a layer at the bottom to make it look like it only has bottom-border.
The problem is that Control.Frame doesn't have Width & Height (their value is 0).
Any help or another way to hack border bottom Entry (UITextField) style? Thanks in advance.


e.NewElement(which is the XamarinEntry) isn't null and apply those dimensions? - Gerald Versluis