Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 KivyMD 中编写 OneLineListItem 以在控制台上打印其“文本”?我想出了这样的事情:
[...] item = OneLineListItem(text="DEMO", on_press= lambda x: ??????? ) list.add_widget(item) [...]
我想在按下 Item 后在控制台上打印“DEMO”字样。
你可以这样做:
item = OneLineListItem(text="DEMO", on_press=lambda x: print(x.text))