FadingEdgeEffect#
New in version 1.0.0. The FadingEdgeEffect class implements a fade effect for KivyMD widgets: Note Use the same color value for the fade_color parameter as for the
parent widget.from kivy.lang import Builder
from kivy.uix.scrollview import ScrollView
from kivymd.app import MDApp
from kivymd.effects.fadingedge.fadingedge import FadingEdgeEffect
from kivymd.uix.list import OneLineListItem
KV = '''
MDScreen:
FadeScrollView:
fade_height: self.height / 2
fade_color: root.md_bg_color
MDList:
id: container
'''
class FadeScrollView(FadingEdgeEffect, ScrollView):
pass
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
def on_start(self):
for i in range(20):
self.root.ids.container.add_widget(
OneLineListItem(text=f"Single-line item {i}")
)
Test().run()
API - kivymd.effects.fadingedge.fadingedge
#
- class kivymd.effects.fadingedge.fadingedge.FadingEdgeEffect(**kwargs)#
The class implements the fade effect.
New in version 1.0.0.
- fade_color#
Fade color.
fade_color
is anColorProperty
and defaults to None.
- fade_height#
Fade height.
fade_height
is anColorProperty
and defaults to 0.
- edge_top#
Display fade edge top.
edge_top
is anBooleanProperty
and defaults to True.
- edge_bottom#
Display fade edge bottom.
edge_bottom
is anBooleanProperty
and defaults to True.