Here is the code for the custom Renderer in iOS. .
my point is i want the text to be under then image, i tried XLabs ImageButton but it's looks like they are not working with the new XamarinForms anymore ....
Xamarin.iOS... .
/* .
Blockquote
public class ButtonCustomRendererIOS : ButtonRenderer
{
public ButtonCustomRendererIOS()
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Button> e)
{
base.OnElementChanged(e);
if(e.NewElement !=null)
{
if (Control != null)
{
#if DEBUG
Control.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
Control.VerticalAlignment = UIControlContentVerticalAlignment.Center;
Control.Layer.CornerRadius = 15;
Control.Layer.BorderWidth = 5;
Control.Layer.BorderColor = Color.Red.ToCGColor();
var uiImage = UIImage.FromFile(((Button)e.NewElement).Image.File);
var lineHeight = Control.TitleLabel.Font.LineHeight;
Control.ImageEdgeInsets = new UIEdgeInsets(-lineHeight, uiImage.Size.Width + (uiImage.Size.Width / 2), 0, 0);
Control.TitleEdgeInsets = new UIEdgeInsets(uiImage.Size.Height, -uiImage.Size.Width, 0, 0);
uiImage.Dispose();
#endif
}
}
}
}
Blockquote
*/ .