Use vector artwork for iOS launch image in asset catalog?

霸气de小男生 提交于 2019-12-01 04:38:38

Unfortunately, I think you can't use vector artwork for ALL of your LaunchImages... ... but there's an approach which makes our lives easier: the new LaunchScreen.xib.

In File > New, you create a new Launch Screen in User Interface:

Now, you can set the new Launch Screen File in your project's target:

In this LaunchScreen.xib you can put your vector artwork, using AutoLayout for adapt your vector to all screen sizes.

Why I told that you can't use vector artwork for ALL sizes? Because it only works in iOS 8+. For iOS 7, I created the PNG image and I put this in LaunchImage asset catalog, in the old way.

PS: I tested this approach only in simulator.

Yes, you can do this with XCode 6. This is a new feature added with the new release.

The Session 441 from WWDC 2014 give you more information about this way :)

  • Make a new image set
  • Click on the blank image set
  • Choose vector into attributes inspector. Now you have a universal image !
  • Drag your vector into this universal slot ;)

Enjoy !

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