Resolution bug when build to Android platform

I set the resolution is 1920x1080, but when i build it the game to android platform, the resolution is incorrect.

It looks like the resolution has changed to 2009x1080(1.86).

I don’t know why this is happening.
Maybe is setting"legacy wide screen"do.

I tired to use Screen.SetResolution(1920, 1080, false) But it looks like stretching the resolution of 1920x1080 and then filling it into the resolution of 2009x1080. It seems that resolution has been locked at 2009x1080

So I want to make the resolution is 1920x1080, how can I do it?

2 Answers

2

I think you need to play around with your Canvas settings, specifically with CanvasScaler and UI Scale Mode, check out the attached image

image

@ajlert11
Canvas Scaler Setting is correct(Landscape)
I think its Application’s resolution isnt correct but I dont know how to solve it.

Ok, let me ask you another question then. What problems do you get because of different resolution on the device? I mean, why does it matter so much in your project?

–

If the resolution is greater than 1920, things outside the Camera may be exposed. For example, if I fill the screen with a sprite, there will be gaps on both sides after building to android platform.

–

hmm, usually UI is made so that it scales up with the resolution via anchors and other properties of RectTransform component. Sprite is an object in 3D world though and I'm not sure you can manipulate the width of the camera frustum, maybe you can calculate it manually based on you reference resolution, but I think it always adjusts to the screen

–

There is no problem with the calculation, but it is too troublesome to adjust back and forth (the resolutions of Windows and Android are different). I still hope to adjust the game resolution. I don’t understand why the game resolution after build does not match the resolution in the editor. Windows is 1920x1080 Android is 2009x1080. Maybe unity does not support building resolutions smaller than 2009x1080 on the Android platform?

–