user interface - how to maximize scrollbar in Kivy python? -
i using multitab in kivy. how enlarge scrollbar scrollbar can moved(up_down) mouse. using boxlayout , recycleview. code below working gridlayout, not in boxlayout:
layout.bind(minimum_height=layout.setter('height'))
here example of how extend scrollview dragable slider.
from kivy.app import app kivy.uix.boxlayout import boxlayout kivy.lang import builder kivy.uix.label import label builder.load_string(""" <scrollslider>: scrollview: id: scrlvw bar_width: 0 gridlayout: id: grid size_hint_y:none cols:1 height: self.minimum_height scroll_y: slider.value on_touch_move: slider.value = self.scroll_y slider: size_hint_x: none width: root.width*0.2 id: slider min: 0 max: 1 orientation: 'vertical' value: scrlvw.scroll_y on_value: scrlvw.scroll_y = self.value """) class scrollslider(boxlayout): def custom_add(self, widget): self.ids.grid.add_widget(widget) class myapp(app): def build(self): scrollslider = scrollslider() in range(1, 100): scrollslider.custom_add(label(text=str(i), height=100, size_hint_y=none)) return scrollslider if __name__ == '__main__': myapp().run()
you need use custom_add
add widgets in scrollslider
or add them gridlayout
in kivy.
i took inspiration link @edvardas dlugauskas provided.
the code provided not work boxlayout
because boxlayout
takes size of parent. able scroll need add sth scrollview
larger scrollview
itself.
Comments
Post a Comment