【发布时间】:2018-02-02 02:41:35
【问题描述】:
我有一个浮动布局,里面有一些小部件:
fl = FloatLayout(size=(600,600),
pos_hint=({'center_x': .5, 'center_y': .5}))
pos1 = ImgButton(source='zulgrey.png',
size_hint=(0.2,0.2),
pos_hint=({'center_x': 0, 'center_y': .43}))
pos2 = ImgButton(source='zulgrey.png',
size_hint=(0.2,0.2),
pos_hint=({'center_x': 0.5, 'center_y': 0.93}))
pos3 = ImgButton(source='zulgrey.png',
size_hint=(0.2,0.2),
pos_hint=({'center_x': 1, 'center_y': .43}))
pos4 = ImgButton(source='zulgrey.png',
size_hint=(0.2,0.2),
pos_hint=({'center_x': 0.5, 'center_y': .43}))
fl.add_widget(cove)
fl.add_widget(pos1)
fl.add_widget(pos2)
fl.add_widget(pos3)
fl.add_widget(pos4)
但是,当我调整窗口大小时,小部件的位置会从我想要的位置移动。有没有办法强制浮动布局在调整大小时具有固定的纵横比?
【问题讨论】:
标签: python layout kivy kivy-language