Launch Screen Storyboard Image Cropping

GimpArmGimpArm Member ✭✭

I've been struggling to make the launch screen on iOS behave how I want it. On Android it was no problem.

Basically I have 1 large image that is large enough for all devices and resolutions. I want it to be centered on the screen regardless of screen size or orientation. This is easy and can be done by constraining to the edges. The problem is my image is always larger than the screen and I want it to be cropped to fit but the behavior I keep getting is that the image is resized to fit which ever direction is smaller leaving the background color visible on the larger direction. I would rather is sizes to the larger direction and cropping on the smaller or cropping on both.

Answers

  • GimpArmGimpArm Member ✭✭

    Yes, I said "This is easy and can be done by constraining to the edges."

    The problem isn't keeping it centered. The problem is that images are automatically scaled to fit the smallest dimension. That doc is only good if you want a small icon centered with a solid background image. Filling the entire screen with an image does not work this way.

  • DannyCDannyC US ✭✭✭✭

    Have you tried using an UIImageView and checking sizeToFit() method?

  • GimpArmGimpArm Member ✭✭

    Do you have an example of how to add code like that to a launch screen storyboard?

  • GimpArmGimpArm Member ✭✭

    I take this to mean no one can actually tell me how this is done and it is probably not possible in Xamarin.

  • DennyyDennyy Member ✭✭

    Still looking for an answer

  • JohnHJohnH GBMember ✭✭✭✭✭
    > @GimpArm said:
    > Do you have an example of how to add code like that to a launch screen storyboard?

    You cannot add code to a launch storyboard, you must solve this with constraints.
  • GimpArmGimpArm Member ✭✭
    So then there is no way to crop an image for the launch screen? So in the new storyboard launch screen your images must always be smaller than the screen with a solid background?
  • JohnHJohnH GBMember ✭✭✭✭✭

    @GimpArm said:
    So then there is no way to crop an image for the launch screen? So in the new storyboard launch screen your images must always be smaller than the screen with a solid background?

    I would be very surprised if you can't, but I have never tried. If its possible in iOS then it is possible in Xamarin.

  • GimpArmGimpArm Member ✭✭
    > @JohnHair said:
    >
    > I would be very surprised if you can't, but I have never tried. If its possible in iOS then it is possible in Xamarin.

    My question has been open since March yet no one can tell me how to do what appears to be a rather simple task.
  • JohnHJohnH GBMember ✭✭✭✭✭

    @GimpArm said:
    > @JohnHair said:
    >
    > I would be very surprised if you can't, but I have never tried. If its possible in iOS then it is possible in Xamarin.

    My question has been open since March yet no one can tell me how to do what appears to be a rather simple task.

    Have you studied how to create storyboards? How constraints work?
    I would suggest googling for how this is done in iOS, not specifically in Xamarin. You might get more examples.

  • znelsonznelson USMember ✭✭

    This is so utterly frustrating. I'm running into the same exact issue and no one can explain how to do this.

Sign In or Register to comment.