Read the original article:Status bar color changes when entering and exiting the app
Problem Description
The status bar color changes suddenly when entering and exiting the application.
Background Knowledge
- setWindowSystemBarProperties is used to set the properties of the navigation bar and status bar in the full-screen main window.
- SystemBarProperties includes properties such as background color, text color, whether the icon is highlighted, and icon animation. For adaptation, please refer to How to Implement Status Bar Background Color Immersion.
Troubleshooting Process
Check the code and search setWindowSystemBarProperties globally. It is found that the statusBarColor in SystemBarProperties is set, and the value is not set to transparent color.
let SystemBarProperties: window.SystemBarProperties = {
statusBarColor: '#000000'
...
}
...
let promise = windowClass.setWindowSystemBarProperties(SystemBarProperties);
Analysis Conclusion
The application changes the background color of the status bar when entering and exiting the application, resulting in a sudden color change.
Solution
Set the statusBarColor value to transparent.
statusBarColor: 'rgba(0, 0, 0, 0)'
Top comments (0)