Hello,
In the native Android platform, by referring to Drawable resources, you could see that the corresponding object for Shape.xaml
is GradientDrawable.
An XML file that defines a geometric shape, including colors and gradients. Creates a GradientDrawable.
As for GradientDrawable, by referring to this native API documentation GradientDrawable, you could see which properties can be fetched.
On Xamarin, you could use the following code to get the values of corners:
var d = button.Background as GradientDrawable;
d.CornerRadius;
However, it is impossible to get the value of solid
and stroke
, due to Android natively does not provide relevant API support.
Best Regards,
Alec Liu.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.