How to change the background color of the app popup menu

Asked

Viewed 716 times

1

I’d like to know how I change the background color of when I open the menu of an app I’m creating.

Follows the style.xml

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

How do I change this color?

  • 1

    Please specify the question and language.

  • I’m creating an android app. and in this application will contain some menus... I want to change the background color of the popup ... this "popup" is the window that opens when you trigger the menu to choose a menu item .. this style.xml is an android studio file that I believe is the right place to change the color I want .. but I don’t know how and exactly what I want to learn..

  • Make a theme and put the colors you want. Download the theme and subtlety in your app. Place the images in the folders do not forget this. https://jgilfelt.github.io/android-actionbarstylegenerator/

1 answer

2


For this you must change the AppTheme.PopupOverlay

Follow an example:

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light">
   <item name="android:background">@color/colorAccent</item>
</style>
  • exactly that thank you very much!!!!!

  • By chance you know how to change the color of when the mouse passes over ..... type becomes lighter ?

  • Mouse? I don’t know if it’s possible!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.