Xamarin Forms 药丸按钮

Xamarin Forms Pill Button

如何在 Xamarin Forms 中将 Button 声明为药丸按钮而不考虑按钮的 width/height?有没有办法在不求助于本机自定义渲染器的情况下做到这一点?我想在 XAML.

中完成 100%

没有自定义渲染器是不可能的。但这里有一篇关于它的好文章:http://www.wintellect.com/devcenter/jprosise/supercharging-xamarin-forms-with-custom-renderers-part-2

您可以在 Button 上指定 BorderRadius 属性 使边角变圆,看起来像药丸。