import kivykivy.require('1.11.0')
from kivy.app import Appfrom kivy.uix.stacklayout import StackLayoutfrom kivy.uix.scrollview import ScrollViewfrom kivy.uix.textinput import TextInput
class Arbrawf(App):
def build(self): stack = StackLayout(orientation='bt-lr', padding=10, spacing=5)
# scrolling stack.size_hint_y = None
stack.bind(minimum_height=stack.setter('height'))
for i in range(25): stack.add_widget(TextInput(text=str(i), size_hint_y=None, height=35))
scroll = ScrollView(do_scroll_x=False) scroll.add_widget(stack) return scroll
if __name__ == '__main__': Arbrawf().run()
ScrollView + StackLayout - orientation='bt-lr'
To create a scrollable TextInput widgets stacking from bottom to top, and then left to right, do the following:
ScrollView + StackLayout - orientation='rl-tb'
import kivy
kivy.require('1.11.0')
from kivy.app import App
from kivy.uix.stacklayout import StackLayout
from kivy.uix.scrollview import ScrollView
from kivy.uix.textinput import TextInput
from kivy.core.window import Window
class Demo(App):
title = "Kivy Scrollable StackLayout Orientation='bt-lr' Demo"
def build(self):
stack = StackLayout(orientation='bt-lr', padding=10, spacing=5)
# scrolling
stack.size_hint_x = None
stack.bind(minimum_width=stack.setter('width'))
for i in range(200):
stack.add_widget(TextInput(text=str(i), write_tab=False, size_hint=(None, None), height=35))
scroll = ScrollView(size_hint=(None, None), size=(Window.width, Window.height),
bar_width=10, bar_color=[0, 1, 0, 1], bar_inactive_color=[1, 0, 0, 1],
effect_cls="ScrollEffect", scroll_type=['bars'])
scroll.add_widget(stack)
return scroll
if __name__ == '__main__':