Issue
What is the default background color in Xamarin Forms Android App in the light mode without applying any custom theme or style? I want to place a button that has the same color as that of the background. The Background color is not White, as when I place Button with White color, the Button's color is different from the background.
I know I can set both Page's and Button's color as White or anything else, but I want to use the same default background color that's provided by Xamarin Forms Android.
<StackLayout>
<Button Text="Button" BackgroundColor="White" />
</StackLayout>
In the output, you can see the white color of the button is slightly different from that of the background.
Here is the output
Solution
You can get your theme's default background color in android project by referencing:
?android:colorBackground
For example,you could open the Resources/values/colors
,and arbitrarily define a color value
<color name="defaultcolor">?android:colorBackground</color>
And then you can see that its color value is
#fffafafa
Answered By - Leo Zhu - MSFT
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.