Search code examples
pythonkivy

Kivy: Change height of the Spinner's dropdown list


I have a spinner, I adapt the height to be 30dp, but in the dropdown list, the different choices keep the default height, how can I access them to change their height ?

from kivy.lang import Builder
from kivymd.app import MDApp

KV = '''
BoxLayout:
    Spinner:
        size_hint_y: None
        height: "30dp"
        values: ["Apple","Orange","Banana"]
'''

class App(MDApp):
    def build(self):
        self.box = Builder.load_string(KV)

        return self.box

App().run()

Solution

  • You can refer to this link https://github.com/kivy/kivy/wiki/Styling-a-Spinner-and-SpinnerOption-in-KV

    In the SpinnerOptions part, you can set height: 30 and I hope it will change...