I've managed to add left and right padding to my custom bordered button. The code is as below:
[assembly: ExportRenderer (typeof (BorderedButton), typeof (BorderedButtonRenderer))]
namespace DutyFreeCollection.iOS
{
public class BorderedButtonRenderer : ButtonRenderer
{
UIButton btn;
public BorderedButtonRenderer () {}
protected override void OnElementChanged (ElementChangedEventArgs<Button> e)
{
base.OnElementChanged (e);
if(e.OldElement == null)
{
btn = (UIButton) Control;
btn.ContentEdgeInsets = new UIEdgeInsets (-20, 20, -20, 20); // Set -20 for top and bot padding, why is the top/bot padding not
//reduced?
}
}
}
}
-20 does not reduce the top and bottom padding. Anyone knows how to reduce top and bottom padding for a custom bordered Button?