我想在我的kivy应用程序上有一个固定宽度的右侧边栏,上面有一个按钮列表和一个主要的绘图区域,我不确定哪种方法是正确的(也就是说,哪种布局),到目前为止我的位置是:
布局pp.py。。。你知道吗
from kivy.app import App
class layoutApp(App):
pass
if __name__ == '__main__':
layoutApp().run()
和布局PP.kv。。。你知道吗
BoxLayout:
orientation: 'vertical'
BoxLayout:
Button:
size_hint_x: 2
BoxLayout:
orientation: 'vertical'
size_hint_x: 0.5
Button:
Button:
Button:
Button:
产生:
问题是大小是相对的,即右侧边栏的宽度根据屏幕抓取/调整大小而变化,这不是预期的行为。你知道吗
谢谢!你知道吗
对@Johnèu Anderson稍作修改,上面的按钮很窄:
结果:
您可以设置侧边栏的宽度,然后使用
ids
使大按钮的宽度取决于此:相关问题 更多 >
编程相关推荐