KivyMD的always_scroll不起作用,每当我向下滚动时,它就会立刻回到顶部。

huangapple go评论66阅读模式
英文:

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:&#39;vertical&#39;
                MDLabel:
                    text: &quot;DISEASE NAME&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 18
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: .8}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[10,0]
                    adaptive_height: True

                MDLabel:
                    text: &quot;Vascular Streak Dieback&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 17
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: .55}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[20,0]
                MDBoxLayout:
                    size_hint: .95, None
                    height: &#39;1dp&#39;
                    pos_hint: {&quot;center_y&quot;: .4, &quot;center_x&quot;:.5}
                    padding: &quot;0dp&quot;
                    spacing: &quot;0dp&quot;
                    orientation: &quot;vertical&quot;
                    elevation: 0
                    md_bg_color:(0.627, 0.510, 0.392, 1.0)
                
                MDLabel:
                    text: &quot;CAUSAL TYPE&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 18
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: .24}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[10,3]

                MDLabel:
                    text: &quot;Fungi&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 16
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: .01}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[20,0]
                    adaptive_height: True

                MDBoxLayout:
                    size_hint: .95, None
                    height: &#39;1dp&#39;
                    pos_hint: {&quot;center_y&quot;: -.15, &quot;center_x&quot;:.5}
                    padding: &quot;50dp&quot;
                    spacing: &quot;0dp&quot;
                    orientation: &quot;vertical&quot;
                    elevation: 0
                    md_bg_color:(0.627, 0.510, 0.392, 1.0)

                MDLabel:
                    text: &quot;CROP STAGE AFFECTED&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 18
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: -.3}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[10,0]
                    adaptive_height: True
                MDLabel:
                    text: &quot;Pre-emergence, Seeding stage, Vegetative growing stage, Flowering stage, Fruiting stage&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 16
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: -.65}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[20,0]
                
                MDBoxLayout:
                    size_hint: .95, None
                    height: &#39;1dp&#39;
                    pos_hint: {&quot;center_y&quot;: -.9, &quot;center_x&quot;:.5}
                    spacing: &quot;0dp&quot;
                    orientation: &quot;vertical&quot;
                    elevation: 0
                    md_bg_color:(0.627, 0.510, 0.392, 1.0)
            
                MDLabel:
                    text: &quot;CAUSAL TYPE&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 18
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: -1.06}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[10,0]
                    adaptive_height: True
                MDLabel:
                    text: &quot;Leaves - discoloration and abnormal with necrotic area ,Stems - mold growth, bark discolorations and dieback , Roots - lesions with necrotic streaks, Whole plant - dwarfing&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 16
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: -1.55     }
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[20,0]
                    adaptive_height: True

                MDBoxLayout:
                    size_hint: .95, None
                    height: &#39;1dp&#39;
                    pos_hint: {&quot;center_y&quot;: -2, &quot;center_x&quot;:.5}
                    spacing: &quot;0dp&quot;
                    orientation: &quot;vertical&quot;
                    elevation: 0
                    md_bg_color:(0.627, 0.510, 0.392, 1.0)
                MDLabel:
                    text: &quot;SIGNS AND SYMPTOMS&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 18
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: -2.15}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    padding:[10,0]
                    adaptive_height: True
                
                MDLabel:
                    text: &quot;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.&quot;
                    font_name: &quot;Raleway-Black.ttf&quot;
                    font_size: 16
                    halign: &quot;left&quot;
                    pos_hint: {&quot;center_y&quot;: -2.65}
                    theme_text_color: &quot;Custom&quot;
                    text_color: &quot;#A08264&quot;
                    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
KivyMD的always_scroll不起作用,每当我向下滚动时,它就会立刻回到顶部。

huangapple
  • 本文由 发表于 2023年5月14日 16:01:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76246439.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定