Skip to content

Instantly share code, notes, and snippets.

@hchandad
Created May 25, 2015 03:14
Show Gist options
  • Save hchandad/de56e0543e2ac886bb2f to your computer and use it in GitHub Desktop.
Save hchandad/de56e0543e2ac886bb2f to your computer and use it in GitHub Desktop.
Horizontal scroll with ScrollView
from kivy.uix.scrollview import ScrollView
from kivy.uix.gridlayout import GridLayout
from kivy.uix.button import Button
from kivy.base import runTouchApp
layout = GridLayout(rows=1, size_hint_x=None)
layout.bind(minimum_width=layout.setter('width'))
for i in range(30):
btn = Button(text=str(i), size_hint_x=None, width=40)
layout.add_widget(btn)
root = ScrollView()
root.add_widget(layout)
runTouchApp(root)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment