Skip to content

Is it possible to change the background color of items of Dropdown component? #844

Answered by chelicksst
chelicksst asked this question in Q&A
Discussion options

You must be logged in to vote

That might help: https://learn.microsoft.com/en-us/answers/questions/1005346/create-own-theme-on-android-in-net-maui

Thank you very much! It helped!) Here's the solution:

In Platforms/Android/Resources/values/colors.xml we override the default styles:

<style name="MyAppTheme" parent="Maui.SplashTheme">
	<item name="android:textColor">@android:color/white</item>
	<item name="android:itemBackground">@android:color/black</item>
</style>

The important thing is the inheritance from Maui.SplashTheme.
Then in Platforms/Android/MainActivity.cs we apply our styles:

[Activity(Theme = "@style/MyAppTheme", ...]
public class MainActivity : MauiAppCompatActivity
{
}

But it removes the border around…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@enisn
Comment options

@chelicksst
Comment options

Answer selected by chelicksst
@chelicksst
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants