Centering an Image for the LaunchScreen.storyboard

NPCNPC USMember ✭✭

I've been building a cross platform PCL .Forms app and recently got to focusing on the IOS portion. I've been trying to create a LaunchScreen that is white with a decal in the center.

I managed to center the image how I'd like in the editor, and hit the '+' constraint button that seemed to auto-generate constraints for the image that match my centering from the bottom and left.

However when launched despite being in the center of the editor, the image is nowhere near centered on the actual splash screen. As if the phone is trying to display what is shown on the editor as in image based in one of it's corners rather than the center. How can I get the phone to display the center of the storyboard rather than a corner?

Best Answer


  • BlueCoder77BlueCoder77 USMember ✭✭

    What I found that worked for me was to set content mode to "Center" and then set the image UI control to fill the entire storyboard screen so that the UI control fills the screen and the image is centered inside of that, instead of trying to center the image view in the screen with constraints. I was able to do this in Visual Studio on my windows desktop.

  • batmacibatmaci DEMember ✭✭✭✭✭

    here is very simple solution
    1) use frame mode

    2) use arrange as in the image. choose all arrows on the left panel

  • XandManXandMan USMember ✭✭

    Has anyone experienced setting/unsetting the Aligment Arrange arrows, only to have them set/unset by themselves? I do! Its frustrating!

    • I drag and drop an image control from the Toolbox
    • I set the actual image file in the Properties
    • Then resize as necessary
    • Center the image by clicking the Center Position Horizontally & Vertically buttons
    • Set all the red alignment rulers (and have tried unsetting them as well)
    • a few seconds later, the alignment rulers reset by themselves.

    End result, I cant center a logo/image in the iOS LauchScreen.

    I also tried, deleting the Storyboard, Added a new one, deleting the View Controller, and adding it back.

    The alignment always resets itself.
    I spent hours going crazy over this....
    Any ideas or help?

    Using Visual Studio 2017, xCode 10.1

Sign In or Register to comment.