Привет! Я написал следующий код
kv file
<TACScreen3>
FloatLayout:
Label:
color: 0,0,0,1
text:'TAX'
pos_hint: {"x":0.01, "y":0.4}
Label:
color: 0,0,0,1
text:'Select Data'
pos_hint:{'left':(0.05,0.05)}
size_hint:0.5,1.4
CustomDropDown:
<CustomDropDown>:
Button:
text: 'My first Item'
size_hint_y: None
height: 44
on_release: root.select('item1')
Button:
text: 'My second Item'
size_hint_y: None
height: 44
on_release: root.select('item2')
Python file
class TACScreen3(Screen):
def __init__(self, **kwargs):
super(TACScreen3, self).__init__(**kwargs)
isShownTable = BooleanProperty(True)
self.dropdown = CustomDropDown()
self.mainbutton = Button(text='Hello',
size_hint=(0.4, 0.1),
pos_hint={"x": 0.5, "y": 0.65})
self.mainbutton.bind(on_release=self.dropdown.open)
self.dropdown.bind(on_select=lambda instance, x: setattr(self.mainbutton, 'text', x))
Мой раскрывающийся список не отображается. Я просто получаю две кнопки в раскрывающемся списке. Не могли бы вы помочь!