파이썬[Python]: kivy - DampedScrollEffect 클래스 - kv
kivy.effects.dampedscroll 모듈 - DampedScrollEffect 클래스(class)
/// 설명
콘텐츠의 마지막 부분에서 바운드 할 경우 천천히 되돌립니다.
참고: animation to gesture 모듈 목록
※ 형식
DampedScrollEffect(**kwargs)
reference
https://kivy.org/doc/stable/api-kivy.effects.dampedscroll.html
참고: animation to gesture 모듈 목록
※ 형식
DampedScrollEffect(**kwargs)
reference
https://kivy.org/doc/stable/api-kivy.effects.dampedscroll.html
/// 예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | import kivy kivy.require('2.0.0') from kivy.app import App from kivy.core.window import Window from kivy.uix.button import Button from kivy.lang import Builder Window.clearcolor = (1, 1, 1, 1) Window.size = (563, 1001) Window.top, Window.left = 30, 700 kv = ''' #:import DampedScrollEffect kivy.effects.dampedscroll.DampedScrollEffect ScrollView: # size_hint: (1, None) # height: app.WIN[1] bar_color: (.5, .1, .1, 1) bar_width: 5 effect_y: DampedScrollEffect() GridLayout id: id_gl cols: 1 size_hint_y: None height: self.minimum_height ''' class FantasticApp(App): WIN = Window.size def on_start(self): for i in range(30): bt = Button(text=f'ScrollView_{i}', size_hint_y=None, height=50) self.root.ids.id_gl.add_widget(bt) def build(self): return Builder.load_string(kv) FantasticApp().run() | cs |
/// 출력
* 실행환경: Microsoft Windows 10 Homes
* 인터프리터: 파이썬(Python 3.9)
– 당신을 응원합니다. –
댓글
댓글 쓰기