Added a simple example for listview, that only takes a list of strings.

This commit is contained in:
Jeff Pittman 2012-07-31 10:02:21 -05:00
parent 867061fe4a
commit fa7009d79d
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
from kivy.uix.listview import ListView
from kivy.uix.gridlayout import GridLayout
class MainView(GridLayout):
'''Implementation of a simple list view with 100 items.
'''
def __init__(self, **kwargs):
kwargs['cols'] = 2
kwargs['size_hint'] = (1.0, 1.0)
super(MainView, self).__init__(**kwargs)
list_view = ListView([str(index) for index in xrange(100)])
self.add_widget(list_view)
if __name__ == '__main__':
from kivy.base import runTouchApp
runTouchApp(MainView(width=800))