问题描述
我希望能提示有关相对布局的位置。
def new_game(self):
box = BoxLayout(orientation='vertical',size_hint=(.7,.8),pos_hint=({'center_x': .5,'center_y': .5}))
left_box = BoxLayout(size_hint_x=.3)
right_box = BoxLayout(size_hint_x=.7)
top_box = BoxLayout(orientation='horizontal',size_hint_y=.85)
bottom_box = RelativeLayout(size_hint_y=.15)
bottom_box.add_widget(Button(size_hint=(.3,.7),'center_y': .5}),on_release=lambda x: self.carousel.load_previous(),text='Начать игру'))
top_box.add_widget(left_box)
top_box.add_widget(right_box)
box.add_widget(top_box)
box.add_widget(bottom_box)
return box
在该图层上添加一个框架后,我发现该位置已移位。
<RelativeLayout>
canvas.before:
Color:
rgba: 1,1,1
Line:
width: 1
rectangle: self.x,self.y,self.width,self.height
这是图片: Relative layout
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)