openharmony 鸿蒙 launch-page-resource-config

2026-08-25 浏览 (1)

Configuring Starting Window Resources

The configuration of starting window resources is similar to other resource configurations. You can classify the resources and configure them for different scenarios. Normally, this approach is used when you configure the starting window content for dark mode or different device types.

Configuring the Starting Window for Dark Mode

  • The dark and light color mode of the starting window only follows the system's color scheme.

The following uses the background color configuration of the enhanced starting window as an example. In the default UIAbility template, the value of startWindowBackgroundColor is $color:start_window_background. You can configure the color in the resources directory in the following way so that the color setting takes effect for dark mode. The configuration of other fields is the same as that of the background color. You can configure the resources corresponding to the field in the resources directory.

  1. Modify the color value of start_window_background in the resources/base/element/color.json file to set the default background color of the starting window in normal mode. Example:

    {
      "color": [
        {
          "name": "start_window_background",
          "value": "#FFFFFFFF"
        }
      ]
    }
    
  2. Modify the color value of start_window_background to #FF000000 in the resources/dark/element/color.json file to set the default background color of the starting window in dark mode. Example:

    {
      "color": [
        {
          "name": "start_window_background",
          "value": "#FF000000"
        }
      ]
    }
    

Configuring the Starting Window for Different Devices

Similar to dark mode, you can create resource directories such as car and tablet in the resources directory and configure different starting window content for these devices. For details, see Creating a Resource Directory and Resource File.

If no resource file is configured for the starting window field in a specific scenario, the resource file in the base directory is used by default.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 application-window-stage

openharmony 鸿蒙 system-window-stage-sys

openharmony 鸿蒙 launch-page-config

openharmony 鸿蒙 native-window-event-filter

openharmony 鸿蒙 window-faqs

openharmony 鸿蒙 Readme-EN

openharmony 鸿蒙 window-overview

openharmony 鸿蒙 windowextensionability-sys

openharmony 鸿蒙 application-window-fa

openharmony 鸿蒙 launch-page-overview

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/9eNNRfUU