The management of LaunchImage is actually quite simple in iOS, especially after Xcode introduced xcassets, it is a completely fool-proof operation. But sometimes we still need to do something with LaunchImage. LaunchImage will disappear immediately after the APP is initialized and the APP interface will be displayed. But sometimes we don’t want it to disappear so quickly (for example, some people want a transition effect, while others want it to disappear after certain settings or data are loaded). This is also very simple. We just need to display LaunchImage again and pin it to the top. For example, However, we have configured so many LaunchImages for different screen resolutions. How do we get the LaunchImage that is suitable for the current screen resolution? The common way is to add all LaunchImage to the project and name them according to the screen resolution, such as (640_960.png 640_1136.png ...) and then use code to splice the corresponding file name in the program and reference it. However, this method is relatively primitive and if Apple releases some devices with other resolutions in the future or the startup image changes, it will need to be manually modified. The project configuration is not good and it will take up more resources (the capacity of the APP will increase again). Cherpak Evgeny on stackflow shared a better way to directly read the settings in NSBundle to get the currently applicable LaunchImage I wrote a demonstration code based on the above picture as an example
This way you can easily get LaunchImage~ |
<<: Who helped Apple come back to life 20 years ago? It was Microsoft!
>>: iOS 9.2 beta arrives with new features that may focus on stylus
In September, everyone focused on the official re...
In December 1994, French explorer Jean-Marin Chau...
There is no doubt that the topic of mini programs...
In the world of marine life, sharks are often kno...
Recently, when I was chatting with a young lady w...
As 2019 is coming to an end, I believe many peopl...
01Add WeChat status With the opening of the Tokyo...
As early as 2016, price-cutting reached a small c...
Have you noticed that restaurants love to use Bas...
Anthony Levandowski, the man at the center of Alp...
During the survey, we found that “growth means” i...
In the past, educational institutions’ promotiona...
[[127723]] Beijing time, February 9 morning news,...
In 1959, the famous archaeologist Xu Xusheng led ...
For mobile applications, mobile scenarios are ver...