[英]KIVY - Rotate the whole Layout
I would like to ask if is even possible to rotate whole Layout in Kivy (including its functionality).我想问一下是否可以在 Kivy 中旋转整个布局(包括它的功能)。
I need to have designed one Layout but I need to create an app with splited screen horizontally and use that Layout on bottom side normaly, but on the top side rotated by 180° (upside down)...我需要设计一个布局,但我需要创建一个水平拆分屏幕的应用程序,并在底部正常使用该布局,但在顶部旋转180° (倒置)...
The problem is that even it looks good, the functionality on the up side (which is upside down) still stays normal (in this case: When I click on Button 2 the Button 1 is clicked and vice versa - that's bad... )问题是即使它看起来不错,上侧(倒置)的功能仍然保持正常(在这种情况下:当我点击按钮 2时,按钮 1被点击,反之亦然 - 这很糟糕......)
My code for Kivy is here:我的 Kivy 代码在这里:
BoxLayout:
orientation: "vertical"
BoxLayout:
canvas.before:
PushMatrix
Rotate:
angle: 180
origin: self.center
canvas.after:
PopMatrix
Test:
Test:
<Test@BoxLayout>:
Button:
text: "Button 1"
Button:
text: "Button 2"
Please, could You somebody give some advice how to solve it?拜托,有人能给点建议如何解决吗?
Thank You a lot.十分感谢。
OK.好的。
Thank to all of You but I've solved it by myself?谢谢大家,但我自己解决了?
Sorry for this topic but if would somebody interested, the solution is in the using of another Layout ('ScatterLayout').对不起这个话题,但如果有人感兴趣,解决方案是使用另一个布局('ScatterLayout')。
Here is the solution:这是解决方案:
BoxLayout:
orientation: "vertical"
BoxLayout:
Test:
rotation: 180
Test:
<Test@ScatterLayout>:
BoxLayout:
Button:
text: "Button 1"
Button:
text: "Button 2"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.