Xamarin iOS LaunchScreen with gradient background

Hakob Hovhannisyan 21 Reputation points
2022-08-16T14:21:55.527+00:00

Hello, I am using an image on the Xamarin iOS LaunchScreen (which combines a gradient background effect and a logo). But I want to change this style and use a gradient background and logo separately. Do I have a chance to find some solution?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,297 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,626 Reputation points Microsoft Vendor
    2022-08-17T08:27:23.273+00:00

    Hello @Hakob Hovhannisyan ,

    Usually, a CAGradientLayer is used to draw a color gradient over its background color. But you can't run code or use custom classes in LaunchScreen.storyboard. As noted in Launch Screens for Xamarin.iOS Apps - Xamarin | Microsoft Learn : A Storyboard used as a Launch Screen must include only simple, built-in UI elements and cannot do any calculations or derive from a custom class.

    I want to change this style and use a gradient background and logo separately

    You can design a gradient image, then add an imageview on the LaunchScreen.storyboard, its image should be this gradient image, and fill the entire screen. Then you can add an another imagview to display your logo.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.