【发布时间】:2019-02-24 19:44:10
【问题描述】:
我想在我的 kivy 应用程序上设置一个固定宽度的右侧边栏,其中包含按钮列表和绘制内容的主要区域,我不确定哪种方法是正确的(即哪种布局),这就是我的位置到目前为止:
layoutApp.py...
from kivy.app import App
class layoutApp(App):
pass
if __name__ == '__main__':
layoutApp().run()
还有 layoutApp.kv...
BoxLayout:
orientation: 'vertical'
BoxLayout:
Button:
size_hint_x: 2
BoxLayout:
orientation: 'vertical'
size_hint_x: 0.5
Button:
Button:
Button:
Button:
产生:
问题在于尺寸是相对的,即右侧边栏宽度会根据屏幕占用/调整大小而变化,这不是预期的行为。
谢谢!
【问题讨论】: