【发布时间】:2017-11-02 11:56:50
【问题描述】:
menu.py
from kivy.app import App
from kivy.lang import Builder
kv_str = Builder.load_string('''
ActionBar:
pos_hint: {'top':1}
ActionView:
use_separator: True
ActionPrevious:
title: 'Example App'
with_previous: False
ActionButton:
text: 'File'
ActionButton:
text: 'Edit'
ActionGroup:
text: 'Tools'
mode: 'spinner'
ActionButton:
text: 'Tool1'
ActionButton:
text: 'Tool2'
ActionButton:
text: 'Tool3'
ActionButton:
text: 'Tool4'
''')
class ExampleApp(App):
def build(self):
return kv_str
if __name__ =='__main__':
ExampleApp().run()
如何设置菜单左侧。现在这些菜单出现在右侧。如何在左侧而不是示例应用程序中设置。之后在菜单下添加小图标(第二行)。
第一行 - 文件编辑工具(带有子菜单)
第二行 - icon1 icon2 icon3
【问题讨论】:
-
您可能想使用 Kivy 下拉列表来创建菜单。请参考我在stackoverflow.com/questions/46312856/…的帖子
-
嘿,谢谢你帮助我。
标签: python-2.7 kivy kivy-language