kivymd / KivyMD

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications. https://youtube.com/c/KivyMD https://twitter.com/KivyMD https://habr.com/ru/users/kivymd https://stackoverflow.com/tags/kivymd
https://kivymd.readthedocs.io
MIT License
2.14k stars 655 forks source link

CommonElevationBehavior example code is not working #1693

Closed Sahil-pixel closed 2 months ago

Sahil-pixel commented 2 months ago

elevation is not showing

Code and Logs

from kivy.uix.behaviors import ButtonBehavior

from kivymd.app import MDApp
from kivymd.uix.behaviors import (
    RectangularRippleBehavior,
    BackgroundColorBehavior,
    CommonElevationBehavior,
)

KV = '''
<ElevationWidget>
    size_hint: None, None
    size: "250dp", "50dp"

MDScreen:

    # With elevation effect
    md_bg_color:[1,1,1,1]
    ElevationWidget:
        pos_hint: {"center_x": .5, "center_y": .6}
        elevation: 4
        shadow_offset: 0, -6
        shadow_softness: 4

    # Without elevation effect
    ElevationWidget:
        pos_hint: {"center_x": .5, "center_y": .4}
'''

class ElevationWidget(
    RectangularRippleBehavior,
    CommonElevationBehavior,
    ButtonBehavior,
    BackgroundColorBehavior,
):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.md_bg_color = "red"

class Example(MDApp):
    def build(self):
        return Builder.load_string(KV)

Example().run()
![Screenshot from 2024-04-26 11-55-45](https://github.com/kivymd/KivyMD/assets/57060638/d4dfd830-e046-4d0d-95de-f35cc0a47512)

Screenshots

Add images to explain us this bug. Paste urls here.

Remove this section if no images here

Versions

HeaTTheatR commented 2 months ago

https://github.com/kivymd/KivyMD/issues/1631

HeaTTheatR commented 2 months ago

elevation_level