I'm trying to put a MDFloatingActionButton in my app.
The button gets its shadow only after pressing it. How can I fix it?
environment:
Python==3.11.5
Kivy==2.3.0
KivyMD==1.2.0
example.py:
from kivymd.app import MDApp
from kivy.lang import Builder
from kivymd.uix.button import MDFloatingActionButton
KV = '''
MDScreen:
MDFloatingActionButton:
icon: 'delete-outline'
type: 'large'
md_bg_color: 'green'
icon_color: 'white'
elevation: 5
pos_hint: {'center_x': .5, 'center_y': .5}
'''
class Example(MDApp):
def build(self):
return Builder.load_string(KV)
Example().run()
Thank you!
Looks like a bug in the
MDFloatingActionButton. Try modifying yourkvto trigger the drawing of the shadow by usingClock.schedule_once()