我想在微调器UI中设置按钮。下面是一些伪示例:
<TemplButton@Button>:
background_normal: 'gfx/button_bgr.png'
background_down: 'gfx/button_act.png'
<TemplSpinner@Spinner>:
background_normal: 'gfx/button_bgr.png'
background_down: 'gfx/button_act.png'
dropdown_cls: TemplButton
option_cls: TemplButton
欢迎任何帮助!
答案 0 :(得分:0)
尝试使用Factory
访问动态类+创建SpinnerOption(Button)类的子类
#:import Factory kivy.factory.Factory
<TemplButton@Button>:
background_normal: 'gfx/button_bgr.png'
background_down: 'gfx/button_act.png'
<TemplSpinnerOption@SpinnerOption>
background_normal: 'gfx/button_bgr.png'
background_down: 'gfx/button_act.png'
<TemplSpinner@Spinner>:
background_normal: 'gfx/button_bgr.png'
background_down: 'gfx/button_act.png'
option_cls: Factory.TemplSpinnerOption