iOS: Multiple launch images

筅森魡賤 提交于 2019-12-03 13:57:05

问题


Is it possible to provide multiple launch images instead of just one Default.png launch image? My goal is, that you have for example 5 different launch images and for every application start it shows another one.

Just in case someone responds with that, I know that there is the possibility to have different launch images for different configurations (e.g. screen orientation). But that's not what I'm looking for. I'd like to have different launch images for exactly the same configuration, with the only variable different being the time of the launch.


回答1:


Judging from this link, I don't believe it's possible. You have some latitude in configuring different launch images for Custom URL Schemes or even to localize them, but other than that, since they are specified in the .plist file so that iOS handles them quickly before your app is processing, that's as much latitude as you get...




回答2:


There are rumors that it's possible to load default image from Document folder:

  • set path in info.plist ../Document/Default.png
  • on each app launch override that Default.png with one of your predefined images
  • *on first launch the start-up screen will be black

PS. I didn't try it, so can't say that it works. And even if it works you can meet problems with Apple review process.




回答3:


Would be possible if you would insert your launch images using javascript/jquery vs. entering plain HTML.

In your script you would have to specify your logic for what splash screen should be used when. Then use this:

 <script type="text/javascript">
   (function() {
      var a;
      if(navigator.platform==="iPad"){
         a = window.orientation === 90 || window.orientation === -90  ? 
             "landscape.jpg":"portrait.jpg"
         } else {
         a = window.devicePixelRatio === 2 ?
              "retina.jpg" : "startup.jpg"
         }
     document.write('<link rel="apple-touch-startup-image" href="'+a+'"/>')
     })()
 </script>      

Your logic would have to add some variable to the images name. So if it's time, you will have

 landscape-Morning.jpg
 landscape-Noon.jpg
 landscape-TeaTime.jpg
 landscape-Evening.jpg

Same for the other images.

Haven't tried this but since you can use javscript to set which image to be displayed depending on orientation it shouldn't be a problem to set which image depending on time of day.



来源:https://stackoverflow.com/questions/9722357/ios-multiple-launch-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!