Python KivyMD 图标未在 Android 应用程序上显示
Python KivyMD icon is not displayed on Andriod app
请帮忙,我正在更新我的 android 应用程序。它是用 KivyMD 编写的。这次我使用了图标。该图标在 Pycharm 上的调试中显示没有问题,但在我的 phone 上却没有。我仍然可以点击它,但我看不到图标。
基维
<WordScreen>
name: 'wordscreen'
MDToolbar:
id: toolbar
title: "VOCGO"
elevation: 5
pos_hint: {'top': 1}
height: '40dp'
right_action_items: [["home-outline", lambda x: app.set_screen()]]
规格
# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas,json,ttf,txt
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy==2.0.0,kivyMD,pillow,requests
# change the major version of python used by the app
osx.python_version = 3
# Kivy version to use
osx.kivy_version = 1.9.1
# (list) Permissions
android.permissions = INTERNET
# (int) Target Android API, should be as high as possible.
android.api = 29
非常感谢您!
其中一个 kivymd 分支有这个错误,我用来确保图标存在的版本在你的 buildozer.spec 要求中使用:
要求=kivymd==0.104.1,kivy==2.0.0,...
如果您的应用程序使用类只有最新的kivymd版本,那么您可以下载最新的模块并将其与要求中指定的kivymd版本0.104.1结合在一起
我终于让它工作了。谢谢你的建议。这与提到的错误有关。我必须指定 sdl2_ttf==2.0.15。诀窍是您必须清理 buildozer 构建。更新规范后,运行
buildozer android clean
然后:
buildozer android debug deploy run logcat
最后我的要求是这样
requirements = python3,kivy==2.0.0rc3,kivymd==0.104.1,sdl2_ttf==2.0.15,pillow,requests
这个需求我也试过了,效果不错
requirements = python3,kivy==2.0.0,kivymd,sdl2_ttf==2.0.15,pillow,requests
请帮忙,我正在更新我的 android 应用程序。它是用 KivyMD 编写的。这次我使用了图标。该图标在 Pycharm 上的调试中显示没有问题,但在我的 phone 上却没有。我仍然可以点击它,但我看不到图标。
基维
<WordScreen>
name: 'wordscreen'
MDToolbar:
id: toolbar
title: "VOCGO"
elevation: 5
pos_hint: {'top': 1}
height: '40dp'
right_action_items: [["home-outline", lambda x: app.set_screen()]]
规格
# (list) Source files to include (let empty to include all the files)
source.include_exts = py,png,jpg,kv,atlas,json,ttf,txt
# (list) Application requirements
# comma separated e.g. requirements = sqlite3,kivy
requirements = python3,kivy==2.0.0,kivyMD,pillow,requests
# change the major version of python used by the app
osx.python_version = 3
# Kivy version to use
osx.kivy_version = 1.9.1
# (list) Permissions
android.permissions = INTERNET
# (int) Target Android API, should be as high as possible.
android.api = 29
非常感谢您!
其中一个 kivymd 分支有这个错误,我用来确保图标存在的版本在你的 buildozer.spec 要求中使用:
要求=kivymd==0.104.1,kivy==2.0.0,...
如果您的应用程序使用类只有最新的kivymd版本,那么您可以下载最新的模块并将其与要求中指定的kivymd版本0.104.1结合在一起
我终于让它工作了。谢谢你的建议。这与提到的错误有关。我必须指定 sdl2_ttf==2.0.15。诀窍是您必须清理 buildozer 构建。更新规范后,运行
buildozer android clean
然后:
buildozer android debug deploy run logcat
最后我的要求是这样
requirements = python3,kivy==2.0.0rc3,kivymd==0.104.1,sdl2_ttf==2.0.15,pillow,requests
这个需求我也试过了,效果不错
requirements = python3,kivy==2.0.0,kivymd,sdl2_ttf==2.0.15,pillow,requests