Search code examples
kivy-language

How to remove elevation of MDDropDownItem in kivymd?


I want to center the dropdown item vertically on the appbar but the shadow looks annoying even after trying to match bg colors. This is my kivy string text

MDDropDownItem:
      id: drop_item
      pos: appbar.pos[0] + dp(20), appbar.pos[1] + dp(30)
      text: "All Dose"
      font_size: "23sp"
      on_release: app.menu.open()

Solution

  • You can use any kind of button to trigger the drop down menu. Then open the menu when it is clicked. I use a MDFlatButton that has no shadow. You can customize it as you like.

        MDFlatButton:
            id: drop_item
            text: "All Dose"
            pos: appbar.pos[0] + dp(20), appbar.pos[1] + dp(30)
            font_size: "23sp"
            on_release: app.menu.open()