- Home /
UI not scaling up on mobile
I'm trying to get my Canvas UI to scale up according to the screen resolution of the device it's on but it's not working.
I've tried the code (attached to camera) here http://answers.unity3d.com/questions/464487/windowed-game-to-fullscreen.html
and here
http://answers.unity3d.com/questions/674726/different-camera-views-in-different-devices.html
Neither seem to make any difference, my UI is still small on the iPad mini I'm testing it on.
Any ideas?
Answer by huloo · Sep 01, 2015 at 07:35 PM
You can add Canvas Scaler (component) to Canvas (Game Object).
Set UI Scale Mode to "Scale With Screen Size" and set the reference resolution you want.
Then, UI elements will be scaled up or down by comparing the reference resolution and your current screen resolution.
Further reference:
http://docs.unity3d.com/Manual/script-CanvasScaler.html http://docs.unity3d.com/Manual/HOWTO-UIMultiResolution.html
:D
I already had the canvas scaler attached to the main canvas, but when I select "Scale with Screen Size" and then try to change the x reference resolution Unity crashes.
Along with this I think you also need to set the '$$anonymous$$atch' value to 0.5, so that it matches height and width both.
Your answer
![](https://koobas.hobune.stream/wayback/20220612002309im_/https://answers.unity.com/themes/thub/images/avi.jpg)