from kivymd.app import MDApp
from kivy.lang import Builder
Screen='''
Screen:
MDFloatingActionButtonSpeedDial:
callback:app.callback
data:app.data
rotation_root_button:True
hint_animation:True
bg_hint_color: app.theme_cls.primary_light
'''
class Wolf(MDApp):
data = {
'help-rhombus': 'Help',
'triangle': 'Setting',
'key': 'Register', } #For running app
def callback(self, instance):
{What to do now,so that it can run different function with different button? }
def build(self):
self.theme_cls.theme_style = 'Dark'
self.theme_cls.primary_palette = 'Green'
screen_r = Builder.load_string(screen)
return screen_r
Wolf().run()
我使用“if”函数创建了 3 个回调函数,但它同时执行所有回调。如果你通过'if'函数解决了它,请在此处上传。