简体   繁体   English

Buildozer - 方向肖像设置不起作用

[英]Buildozer - Orientation Portrait setting not working

I am a Python Kivy learner.我是 Python Kivy 学习者。 As part of learning, 2 months back i successfully build a calculator app through google collab.作为学习的一部分,2 个月前我通过 google collab 成功构建了一个计算器应用程序。 The app was working perfectly.该应用程序运行良好。 Now when i build the same app, it builds successfully but the orientation doesnt work.现在,当我构建相同的应用程序时,它构建成功但方向不起作用。 It rotates to all direction.它向各个方向旋转。

orientation = portrait方向 = 纵向

doesnt seem to work now.现在似乎不起作用。

I tried building other apps too recently through google collab, and the same orientation problem persist.我最近尝试通过 google collab 构建其他应用程序,但同样的方向问题仍然存在。 Anyone recently built app through collab successfully without the orientation problem?最近有没有人通过协作成功构建应用程序而没有方向问题?

import os导入操作系统

os.environ["KIVY_ORIENTATION"] = "Portrait" os.environ["KIVY_ORIENTATION"] = "纵向"

adding this at the top of the main.py solves the issue.在 main.py 的顶部添加它可以解决问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM