protected override AppCompatButton CreateNativeControl() { var context = new ContextThemeWrapper(Context, Resource.Style.Widget_AppCompat_Button_Borderless); var button = new AppCompatButton(context, null, Resource.Style.Widget_AppCompat_Button_Borderless); button.SetPadding(0, 0, 0, 0); button.SetLineSpacing(0, 0); button.SetMinWidth(1); button.SetMinWidth(1); button.SetMinimumHeight(1); button.SetMinimumWidth(1); button.SetPaddingRelative(0, 0, 0, 0); //button.Set(0,0,0,0); return(button); }
protected override void OnElementChanged(ElementChangedEventArgs <Button> e) { base.OnElementChanged(e); if (e.OldElement != null) { _myButton = e.OldElement as SizedButton; } if (e.NewElement != null) { _myButton = e.NewElement as SizedButton; } if (Element != null) { _myButton = Element as SizedButton; } if (Control != null) { _androidButton = Control; _androidButton.AddOnLayoutChangeListener(this); } else { _androidButton = CreateNativeControl(); SetNativeControl(_androidButton); } if (_myButton != null) { // _androidButton.SetPadding((int)_myButton.Padding.Left, (int)_myButton.Padding.Top, //(int)_myButton.Padding.Right, (int)_myButton.Padding.Bottom); // _androidButton.SetWidth(_androidButton.Width + ((int)_myButton.Padding.Left + (int)_myButton.Padding.Right)); _androidButton.SetIncludeFontPadding(false); } //_androidButton.SetPadding((int) _myButton.Padding.Left, (int) _myButton.Padding.Top, // (int) _myButton.Padding.Right, (int) _myButton.Padding.Bottom); _androidButton.SetMinimumHeight(0); _androidButton.SetMinimumWidth(0); }