lorenzw
lorenzw

Reputation: 396

change default color for many controls

is there any way to change the "Default Color" for Controls in Xamarin Forms (particularly in Android)? The Controls, which you see in the Pictures all use the same color, and because of that i think there is something like a default resource. I have seen that you can change the colors manually, but i don't want to make a template for the picker, and each other control that hasn't a property built in for this color.

ListView:

The Underline of the Picker when clicked:

and The Window which opens when the Picker is clicked:

Can i somehow change this default color?

Upvotes: 2

Views: 1320

Answers (3)

Dmitry Zinoviev
Dmitry Zinoviev

Reputation: 588

You need to check your styles in android.

Droid Project-> Resourse folder -> Values folder -> styles.xml

There is colorPrimary and colorAccent. So you need to change it to your color

You can customize your app with styles.xml. For mode details look at android styles and themes.

Edit:

Also if you click on the 3 dots on background in Attributes, you can edit and add color resources. See example picture

Resource Editor

Upvotes: 1

Raimo
Raimo

Reputation: 1534

There are a few attributes you can change in your AppTheme that you use which you declared in your styles.xml

There are a few like colorPrimary, colorPrimaryDark, colorAccent, colorControlNormal, etc.

I found this cheat sheet in the past, which might be outdated but might come in handy for you: Android Color Control Cheat Sheet.

Upvotes: 0

Aiko West
Aiko West

Reputation: 791

Change the colorPrimary and colorAccent of your AppTheme in Styles.xml

Upvotes: 1

Related Questions