KivyMD 中 MDIconButton 的涟漪效应可以消除吗?
我正在尝试使用 python KivyMD 开发一个应用程序,为了更好的用户体验,我想删除 MDIconButton 的涟漪效果
main.py
from kivymd.app import MDApp
from kivy.uix.relativelayout import RelativeLayout
class MainWidget(RelativeLayout):
pass
class TestApp(MDApp):
def build(self):
self.theme_cls.theme_style = "Dark"
if __name__ == '__main__':
TestApp().run()
test.kv
MainWidget:
RelToolBar:
<RelToolBar@RelativeLayout>:
size_hint: 1,.05
pos_hint: {'x':0 , 'top':1 }
canvas.before:
Color:
rgba: 0, 0, 0, .4
Rectangle:
size: self.size
MDIconButton:
halign: "center"
icon: "menu"
theme_text_color: "Primary"
pos_hint: {'x':0 , 'center_y':.5 }
MDLabel:
text: "T E S T"
theme_text_color: "Primary"
halign: 'center'
font_style: "Caption"
答案 0 :(得分:0)
我认为您无法删除它,但您可以通过将 RippleBehavior
的大小更改为 0 来隐藏它:
MDIconButton:
ripple_scale: 0