0
现在我通过kivy创建应用程序GUI其他部件之上显示ContextMenuTextItem,和我有一个问题如下:如何Kivy
当我点击标题上的“作业”,有一个菜单,问题是菜单被其他组件重叠(textinput ...)。我怎么能在textinput上显示这个菜单?请参阅图片了解更多详情。
#: import main todo
#: import ListAdapter kivy.adapters.listadapter.ListAdapter
#: import ListItemButton kivy.uix.listview.ListItemButton
Root:
task_input: task_input_view
task_list: tasks_list_view
text_input: text_input
BoxLayout:
orientation: 'vertical'
id: layout
AppMenu:
id: app_menu
top: root.height
cancel_handler_widget: layout
AppMenuTextItem:
text: "Job"
ContextMenu:
ContextMenuTextItem:
text: "Open"
on_release: root.show_load()
ContextMenuTextItem:
text: "Save"
on_release: root.show_save()
ContextMenuTextItem:
text: "SaveAs"
ContextMenuDivider:
ContextMenuTextItem:
text: "Exec"
BoxLayout:
size_hint_y: None
height: "40dp"
TextInput:
id: task_input_view
size_hint_x: 70
Button:
text: "Add"
size_hint_x: 15
on_press: root.add_task()
Button:
text: "Del"
size_hint_x: 15
on_press: root.del_task()
ListView:
id: tasks_list_view
adapter:
ListAdapter(data=[], cls=main.TaskButton)
TextInput:
id: text_input
text: ''