目录

应用启动时页面周边有白边

问题现象

应用启动时动效异常,启动图片未铺满屏幕,周边有空白。

背景知识

问题定位

  1. 根据entry\src\main\module.json5配置文件中startWindowIcon设置的图片资源,查看该图片资源的大小。
    {
      "abilities": [{
        "name": "EntryAbility",
        "srcEntry": "./ets/entryability/EntryAbility.ets",
        "launchType":"singleton",
        "description": "$string:description_main_ability",
        "icon": "$media:layered_image",
        "label": "Login",
        "startWindow": "$profile:start_window",
        "startWindowIcon": "$media:startWindow",
        "startWindowBackground": "$color:red",
        "process": ":processTag"
      }]
    }

  2. 在系统设置中查看屏幕的尺寸,启动页图片的大小与屏幕尺寸不一致。

分析结论

启动页图片的大小与设备分辨率不一致,导致应用启动动画周边有空白。

修改建议