Welcome to our Microsoft Q&A platform!
Launch Image has been deprecated after iOS 13, setting
LaunchScreen.storyboard is necessary. The size of the image depends on how you want to display the launchscreen page, it is about autolayout.
My image size is
400*400 and it shows in center of the screen, you could refer to the following steps:
- Create an image set, select Assets.xcassets, right click New Image Set, give it a name(my image name is
launch) , add two image( 800*800 px
@2xone, 1200*1200 px
@3xone) under Universal section.
- Add an ImageView to viewcontroller in
- Set the constrains
Image(my image name is
launch) to this ImageView, set the Content Mode of ImageView to
AspectFit, then set the AutoResizing to scale to the screen size. When you selsect the ImageView, AutoResizing is under the second-to-last inverted triangle sign on the right toolbar, all outer arrows should be deselected and all inner arrows selected.
Then set the
Center X and
Center Y of the ImageView.
After above steps, you could run to check the effect, the launch page disappears very quickly, it may disappear when you rotate the screen.
There are also other ways to set the constrains, refer to https://stackoverflow.com/questions/37951817/launch-screen-storyboard-with-centered-image-ios
About LaunchScreen, you could refer to https://learn.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/launch-screens?tabs=macos
About Auto Layout, you could refer to https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/index.html
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.