问题描述:

I am using ListItemButton in my code. But I am not able to change the size of list item button.

Please someone guide how to change the button size of ListItemButton.

I have tried using 'size_hint_y: None' and 'height: '48dp'' in order to achieve this but still unsuccessful.

Below you can see the sample code.

main.py

from kivy.app import App

from kivy.uix.boxlayout import BoxLayout

class TestRoot(BoxLayout):

pass

class TestApp(App):

pass

if __name__ == '__main__':

TestApp().run()

Test.kv

#: import ListItemButton kivy.uix.listview.ListItemButton

#: import ListAdapter kivy.adapters.listadapter.ListAdapter

TestRoot:

orientation: "vertical"

Label:

text: "How to the change the button height of ListItemButton?"

ListView:

adapter: ListAdapter(data = ['0','1','2','3','4','5','6','7','8','9'], cls = ListItemButton)

Kivy Question On Listitembutton

相关阅读:
Top