[英]Kivy FloatLayout in multiple screens
The FLoatLayout in kivy seems to restricted to only one screen per time. kivy 中的 FLoatLayout 似乎每次仅限于一个屏幕。 I want to use multiple screens and apply FloatLayout on all of them.
我想使用多个屏幕并在所有屏幕上应用 FloatLayout。
ps.附言。 The reason I want to use FloatLayout is to avoid overlapping widgets.
我想使用 FloatLayout 的原因是避免重叠的小部件。 I wouldn't mind using another layout if it produces a similar result.
如果它产生类似的结果,我不介意使用另一种布局。
You can add another layout in your screen like this (in the kv part of the code):您可以像这样在屏幕中添加另一个布局(在代码的 kv 部分中):
ScreenManager:
id: screens
Screen:
name: "main"
id: main
BoxLayout:
id: main_box
You can do something similar in the python part of the code by using:您可以使用以下代码在代码的 python 部分中执行类似的操作:
main_box = BoxLayout()
self.ids.main.add_widget(main_box)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.