In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how to start the white screen of the Flutter Android application, I believe most people do not know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's learn about it together.
Problem generation
The flutter project generated by default will be blank at startup. The worse the device performance, the longer the white screen. Native Android development will encounter similar problems, such as white or black screen problems when starting up. In Android development, you usually set up a theme file, which is not expanded here.
How to solve
Flutter actually provides a solution. Open the AndroidManifest.xml file under the flutter project directory "\ android\ app\ src\ main", and you can see the following:
Before flutter renders the first frame, you can display an Android view through the configuration here, which is used to display a startup picture. For the period between app startup loading and flutter starting rendering, there is a good transition. All in all, the configuration here is to implement our startup picture and eliminate the white or black screen.
Note here that my current version of flutter is 2.12.0. The configuration of the lower version is not the same, but the principle is probably the same.
As soon as we see this, we already know that we can modify "@ drawable/launch_background".
Change it to the following:
Mipmap/doubanio is a picture in png format that you put in the mipmap directory. In this way, when app starts again, it will not be a blank screen, but a picture that you customize.
Android:gravity= "fill" means that the picture is set to stretch to achieve the effect of full screen.
In addition, it should be noted that there will be multiple drawable and mipma files under the project directory, so remember to make changes.
The above is all the contents of the article "what to do when the Flutter Android app starts the white screen". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.