Slider¶
See also
Sliders allow users to make selections from a range of values.
With value hint¶
from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
Screen
MDSlider:
min: 0
max: 100
value: 40
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
Test().run()
Without value hint¶
MDSlider:
min: 0
max: 100
value: 40
hint: False
Without custom color¶
MDSlider:
min: 0
max: 100
value: 40
hint: False
humb_color_down: app.theme_cls.accent_color
API - kivymd.uix.slider
¶
-
class
kivymd.uix.slider.
MDSlider
(**kwargs)¶ Bases:
kivymd.theming.ThemableBehavior
,kivy.uix.slider.Slider
-
active
¶ If the slider is clicked.
active
is anBooleanProperty
and defaults to False.
-
hint
¶ If True, then the current value is displayed above the slider.
hint
is anBooleanProperty
and defaults to True.
-
show_off
¶ Show the ‘off’ ring when set to minimum value.
show_off
is anBooleanProperty
and defaults to True.
-
thumb_color
¶ Current color slider in
rgba
format.thumb_color
is anAliasProperty
that returns the value of the current color slider, property is readonly.
-
thumb_color_down
¶ Color slider in
rgba
format.thumb_color_down
is anAliasProperty
that returns and set the value of color slider.
-
on_hint
(self, instance, value)¶
-
on_value_normalized
(self, *args)¶ When the
value == min
set it to ‘off’ state and make slider a ring.
-
on_show_off
(self, *args)¶
-
on__is_off
(self, *args)¶
-
on_active
(self, *args)¶
-
on_touch_down
(self, touch)¶
-
on_touch_up
(self, touch)¶
-