英文:
KivyMD always_scroll doesn't work, and whenever I scroll down It goes right back up
问题
Scroll works but it doesn't overscroll beyond the bounds of the content; it always goes back up whenever I scroll down.
英文:
Hello guys I'm new to Kivy and the documentation was hell, so I am confused rn, Im making a cacao disease information app and always_scroll was already defined in my code but it still doesnt work. Can you help me? Thanks <#
ScrollView:
id: scroll_view
always_scroll: True
MDFloatLayout:
adaptive_height: True
orientation:'vertical'
MDLabel:
text: "DISEASE NAME"
font_name: "Raleway-Black.ttf"
font_size: 18
halign: "left"
pos_hint: {"center_y": .8}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[10,0]
adaptive_height: True
MDLabel:
text: "Vascular Streak Dieback"
font_name: "Raleway-Black.ttf"
font_size: 17
halign: "left"
pos_hint: {"center_y": .55}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[20,0]
MDBoxLayout:
size_hint: .95, None
height: '1dp'
pos_hint: {"center_y": .4, "center_x":.5}
padding: "0dp"
spacing: "0dp"
orientation: "vertical"
elevation: 0
md_bg_color:(0.627, 0.510, 0.392, 1.0)
MDLabel:
text: "CAUSAL TYPE"
font_name: "Raleway-Black.ttf"
font_size: 18
halign: "left"
pos_hint: {"center_y": .24}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[10,3]
MDLabel:
text: "Fungi"
font_name: "Raleway-Black.ttf"
font_size: 16
halign: "left"
pos_hint: {"center_y": .01}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[20,0]
adaptive_height: True
MDBoxLayout:
size_hint: .95, None
height: '1dp'
pos_hint: {"center_y": -.15, "center_x":.5}
padding: "50dp"
spacing: "0dp"
orientation: "vertical"
elevation: 0
md_bg_color:(0.627, 0.510, 0.392, 1.0)
MDLabel:
text: "CROP STAGE AFFECTED"
font_name: "Raleway-Black.ttf"
font_size: 18
halign: "left"
pos_hint: {"center_y": -.3}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[10,0]
adaptive_height: True
MDLabel:
text: "Pre-emergence, Seeding stage, Vegetative growing stage, Flowering stage, Fruiting stage"
font_name: "Raleway-Black.ttf"
font_size: 16
halign: "left"
pos_hint: {"center_y": -.65}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[20,0]
MDBoxLayout:
size_hint: .95, None
height: '1dp'
pos_hint: {"center_y": -.9, "center_x":.5}
spacing: "0dp"
orientation: "vertical"
elevation: 0
md_bg_color:(0.627, 0.510, 0.392, 1.0)
MDLabel:
text: "CAUSAL TYPE"
font_name: "Raleway-Black.ttf"
font_size: 18
halign: "left"
pos_hint: {"center_y": -1.06}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[10,0]
adaptive_height: True
MDLabel:
text: "Leaves - discoloration and abnormal with necrotic area ,Stems - mold growth, bark discolorations and dieback , Roots - lesions with necrotic streaks, Whole plant - dwarfing"
font_name: "Raleway-Black.ttf"
font_size: 16
halign: "left"
pos_hint: {"center_y": -1.55 }
theme_text_color: "Custom"
text_color: "#A08264"
padding:[20,0]
adaptive_height: True
MDBoxLayout:
size_hint: .95, None
height: '1dp'
pos_hint: {"center_y": -2, "center_x":.5}
spacing: "0dp"
orientation: "vertical"
elevation: 0
md_bg_color:(0.627, 0.510, 0.392, 1.0)
MDLabel:
text: "SIGNS AND SYMPTOMS"
font_name: "Raleway-Black.ttf"
font_size: 18
halign: "left"
pos_hint: {"center_y": -2.15}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[10,0]
adaptive_height: True
MDLabel:
text: "Symptoms may vary from time to time, initially, chlorosis of the leaf may observed. Chlorosis may begin either at the tip or base of the leaf. Falling of leaves may observed in mid range."
font_name: "Raleway-Black.ttf"
font_size: 16
halign: "left"
pos_hint: {"center_y": -2.65}
theme_text_color: "Custom"
text_color: "#A08264"
padding:[20,0]
adaptive_height: True
Scroll works but it doesnt over scroll beyond the bounds of the content, It always go back up whenever I scroll down.
答案1
得分: 0
尝试将 always_scroll = True
替换为以下内容:
effect_cls: DampedScrollEffect
这应该允许您滚动查看内容。
如果这不起作用,也许您的意思是
always_overscroll: True
还注意到第一行之后有双重缩进,我不确定这是否正确。
英文:
Instead of always_scroll = True try this:
effect_cls: DampedScrollEffect
This should allow you to scroll past the content.
If this doesnt work the perhaps you meant
always_overscroll: True
Also noticed you have a double indentation after the first line which Im not sure is right
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论