How to set linear gradient to background of LaunchScreen.xib in iOS

Vesmy picture Vesmy · Sep 5, 2017 · Viewed 12.8k times · Source

Is there any way to set linear gradient to background of LaunchScreen.xib in iOS? Something like background="linear-gradient(#000000, #123456)"?

<view contentMode="scaleToFill" background="...">
    <rect key="frame" width="753" height="867"/>
</view>

Answer

lenooh picture lenooh · Oct 30, 2018

You can create a vector image (pdf) with a gradient, add an ImageView to launchscreen and set that vector as the image.

If the image doesn't show up, clear the Xcode cache, restart Xcode, delete the app from your device, restart the device, and then it should show up.