0

I've got a weird issue with Unity, where the height of the screen doesn't match the layout built in the editor, but only on iOS. It does work in the editor, in a Windows standalone and in the Android app, but not on iOS (im testing on an iPhone 5).

So the menu layout can be broken down to just a couple of full width images with different y-positions. These images are set to stretch in height, so no matter how I change the play-preview in the editor, they always fill the screen as intended.

As soon as I test it on the iPhone however, it looks like there was height added to the screen after calculating all the image heights or something. Every image seems to be about 10% too short.

This all did work some weeks ago, when I was on an older iOS version, xcode version and Unity version, but I updated them all in the meantime, so I can't say which one could be the cause for this.

Some weeks ago, the minimum iOS version in Unity was set to 7.0, now it has to be at least 8.0 to not get the "update project settings" warning in xcode.

The roughly 10% could be the iOS status bar, which could be taken into account for the height calculations, but then turned off and the game can span over the whole height.

The iOS "Resolution and Presentation" settings are set to require fullscreen and hide status bar.

Edit: Here's what it looks like in the editor and on iOS. Editor The 4 different canvas have just different settings for the canvas scaler. The images in all of them have their RectTransform set to stretch in both directions. iOS

8
  • What's the question? Commented Aug 13, 2017 at 19:19
  • The question is: What is the cause of this difference in look? Commented Aug 13, 2017 at 19:20
  • Can you at-least put screenshot of the different looks? Commented Aug 13, 2017 at 19:21
  • Ok, I'll add screenshots. Commented Aug 13, 2017 at 19:22
  • Which one is the iOS? Commented Aug 13, 2017 at 19:48

1 Answer 1

0

It turned out to be caused by the generation of mipmaps. I don't know why this is the cause and I don't know, why it's only a problem on iOS, but not on any other common platform, but once I used an image that had mipmaps disabled, it worked. It then also worked on the original images, once I deactivated the mipmaps there.

I guess it has someting to do with the gradient images being 1x1920, so mipmaps make little sense. I'm wondering, why this is making the height buggy and not the width.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.