#stacklayout.kv
Scroll:
<Scroll@ScrollView>:
Stacklayout:
size_hint: 1, None
height: self.minimum_height
<Stacklayout>:
#left-right top-bottom
orientation: "rl-bt"
#padding: {"20dp", "20dp", "20dp", "20dp"}
spacing: "20dp"
-----------------------------
from kivy.app import App
from kivy.metrics import dp
from kivy.uix.button import Button
from kivy.uix.stacklayout import StackLayout
from kivy.uix.widget import Widget
class Stacklayout(StackLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
for i in range(100):
b = Button(text=str(i+1), size_hint=(None, None), size=(dp(100), dp(100)))
self.add_widget(b)
class StacklayoutApp(App):
pass
StacklayoutApp().run()
reference:
No comments:
Post a Comment