How to remove extra padding from button views in Xamarin Forms for Android?

后端 未结 3 987
执念已碎
执念已碎 2021-01-13 05:12

The button views on Xamarin Forms seem to get extra padding applied when deployed to Android. I have set Resources/values/styles.xml under my Android project to have all spa

3条回答
  •  庸人自扰
    2021-01-13 05:43

    Well you can use the Device.Runtime platform, described on this link.

    Basically you can choose the type of margin depending on the operating system.

    if(Device.RuntimePlatform == Device.Android)
        button.margin = new Thickness(0);
    

    Is this what you were looking for?

提交回复
热议问题