【问题标题】:How to fit presplash screen to the aspect ratio of the device?如何使预启动屏幕适合设备的纵横比?
【发布时间】:2021-07-02 11:28:56
【问题描述】:

我是一个尝试做计算器的 Python 初学者。我需要一点帮助。当我运行使用 Buildozer 打包的应用程序时,预启动屏幕将与设备的屏幕尺寸不匹配。(在照片上)我知道我必须在 buildozer.spec 文件中执行此操作。我怎样才能做到这一点?

【问题讨论】:

    标签: python kivy buildozer


    【解决方案1】:

    在 buildozer 规范中,您只能设置启动图像的文件名。

    但您的图片应为 512 x 512 像素以适应所有方向和设备。

    查看 buildozer 文档:

    https://buildozer.readthedocs.io/en/latest/specifications.html

    如果你是为 android 开发的,你可以使用 android.presplash_color 设置 presplash 背景颜色。

    # (string) Presplash background color (for new android toolchain)
    # Supported formats are: #RRGGBB #AARRGGBB or one of the following names:
    # red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,
    # darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,
    # olive, purple, silver, teal.
    android.presplash_color = #FFFFFF
    

    例如,如果您使用宽高比为 1:1 的漂亮透明初始图像并设置漂亮的蓝色背景,它将适用于许多设备和 Orinetations。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-09
      • 1970-01-01
      • 2011-09-27
      • 2014-03-27
      • 1970-01-01
      • 1970-01-01
      • 2011-10-13
      相关资源
      最近更新 更多