Giter Site home page Giter Site logo

Comments (7)

anpin avatar anpin commented on May 28, 2024

hi @Shaboo , what do you mean by background number and what are you trying to achieve?

from contextmenucontainer.

Shaboo avatar Shaboo commented on May 28, 2024

holy, I meant Background Color

basically I want the background Color of the Whole menu to be changed, now it is always kinda white

from contextmenucontainer.

anpin avatar anpin commented on May 28, 2024

I think one way to achieve that is to change your app theme as described here https://stackoverflow.com/questions/21231404/how-to-change-background-color-popup-menu-android

from contextmenucontainer.

mhrastegari avatar mhrastegari commented on May 28, 2024

Couldn't be cross platform option? like a background color property?
it would be really useful, specially when you dealing with Dark & Light mode stuff.

from contextmenucontainer.

anpin avatar anpin commented on May 28, 2024

nope, since other platforms doesn't provide such functionality. Also provided solution should be sufficient to support light and dark modes on Android.

from contextmenucontainer.

Shaboo avatar Shaboo commented on May 28, 2024

@anpin thanks for the suggestion, I did the following

in Styles.xml

<style name="pop" parent="Widget.AppCompat.PopupMenu">
    <item name="android:textColor">@android:color/white</item>
    <item name="android:itemBackground">#606060</item>
</style>

and inside MainTheme I added

 <style name="MainTheme" parent="MainTheme.Base">
     ......
    <item name="android:popupMenuStyle">@style/pop</item>
  </style>

then in ContextMenuContainerRenderer.ConstructNativeMenu

Context wrapper = new ContextThemeWrapper(Context, Resource.Style.pop);
contextMenu = new PopupMenu(wrapper, child);

then it worked, thanks again

from contextmenucontainer.

anpin avatar anpin commented on May 28, 2024

from contextmenucontainer.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.