問題描述
當我在手機上啟動我的應用程序(基于 kivy)時,有 1 到 2 秒的時間顯示初始屏幕,顯示正在加載...",然后主窗口才可見.
When I launch my app (based on kivy) on my phone, there is 1 ~ 2 seconds showing the splash screen, says 'Loading...', before the main window becomes visible.
如何在代碼(main.py)或配置中的某處刪除它(我發現沒有與此相關的配置(kivy.config)?這似乎與OpenGL或pygame有關?
How can I remove this in the code(main.py) or somewhere in the config(I found no config related to this(kivy.config)? Does this seems to related to OpenGL or pygame?
推薦答案
這個屏幕是python-for-android進程的一部分,不是你可以在你的kivy應用中直接修改的.
This screen is part of the python-for-android process, not something you can directly modify in your kivy app.
正如您所評論的,您可以使用 build.py 的 --presplash
選項更改顯示的圖像.如果使用 buildozer,您將改為在 buildozer.spec 文件中設置 presplash.filename
標記.
As you commented, you can change what image is displayed with the --presplash
option for build.py. If using buildozer, you would instead set the presplash.filename
token in your buildozer.spec file.
也許可以通過深入研究 python-for-android 以某種方式修改該過程,但我從未見過這種討論,而且我對您是否可以做出任何真正的改變知之甚少.問題是在 java 應用程序初始化和 python/kivy 應用程序準備好顯示任何東西之間,一些加載時間是必不可少的.據我所知,您可以在 python 文件中做的最好的事情是在 build
方法中執行盡可能少的計算.
It might be possible to modify the process somehow by delving into python-for-android, but I've never seen this discussed and I have very little idea of whether there are any real changes you can make. The problem is that some loading period is essential in between the java app initialising and the python/kivy app being ready do display anything. As far as I know, the best you can do in your python file is to perform as little computation as possible in your build
method.
這篇關于移除或更換啟動時的 kivy 閃屏的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!