I use Xamarin.Forms, I try set BorderRadius = 10 or BorderRadius = Device.OnPlatform<int>(iOS: 0, Android: 10, WinPhone: 10) . On UWP it's ok (both ways) but on android BorderRadius in not apply
Button I want change BorderRadius from Button
Problem is with the ButtonRenderer of Xamarin Forms for Android. There are two kinds of ButtonRenderers for Android:
ButtonRenderer under Xamarin.Forms.Platform.Android namespace and ButtonRenderer under Xamarin.Forms.Platfrom.Android.AppCompat namespace.
By default in Xamarin.Forms, it will use the ButtonRenderer under the Xamarin.Forms.Platfrom.Android.AppCompat namespace to render the button, but this renderer doesn't create a border for Button, so the BorderRadius properties doesn't work for the buttons which are rendered with this renderer.
To solve this issue, you can create your own custom button with Custom Renderer, and use the ButtonRenderer under Xamarin.Forms.Platform.Android namespace for rendering.
For creating a Custom renderer for your Button, you can refer to this discussion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With