DropdownItem#
Usage#
from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
MDScreen
MDDropDownItem:
id: drop_item
pos_hint: {'center_x': .5, 'center_y': .5}
text: 'Item'
on_release: print("Press item")
'''
class Test(MDApp):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.screen = Builder.load_string(KV)
def build(self):
return self.screen
Test().run()
API - kivymd.uix.dropdownitem.dropdownitem
#
- class kivymd.uix.dropdownitem.dropdownitem.MDDropDownItem(*args, **kwargs)#
Dropdown item class.
For more information, see in the
DeclarativeBehavior
andThemableBehavior
andButtonBehavior
andBoxLayout
classes documentation.- text#
Text item.
text
is aStringProperty
and defaults to ‘’.
- current_item#
Current name item.
current_item
is aStringProperty
and defaults to ‘’.
- font_size#
Item font size.
font_size
is aNumericProperty
and defaults to ’16sp’.