HarmonyOS flutter app启动目前是白色背景 是否可自定义样式?

app启动 进入首页前有白屏情况 是否可以自定义样式(logo+纯色背景)

阅读 636
1 个回答

在moudle.json5里面

"abilities": [ 
{ 
  "name": "EntryAbility", 
"srcEntry": "./ets/entryability/EntryAbility.ets", 
"description": "$string:EntryAbility_desc", 
"icon": "$media:ic_eshop", 
"label": "$string:EntryAbility_label", 
"startWindowIcon": "$media:ic_eshop", 
"startWindowBackground": "$color:start_window_background", 
"exported": true, 
"skills": [ 
  { 
    "entities": [ 
    "entity.system.home" 
    ], 
    "actions": [ 
    "action.system.home" 
    ] 
  } 
  ] 
} 
]

更改背景色

"startWindowBackground": "$color:start_window_background"

更改图片

"icon": "$media:ic_eshop"

开发者白屏需要自己定义下页面加载样式

@Builder 
componentBuilder() { 
  // 自定义加载界面的样式 
  Column() { 
    Text("Loading...") 
  } 
}

参考链接:

https://gitee.com/openharmony-sig/flutter\_engine/pulls/205

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进