- Home /
ui scaling on mobile
having an issue with a scrolling layout not stretching to fill horizontally on mobile screens, it fits perfectly in the game and scene, i believe its because an anchor is pointing to the top left, but that same anchor is needed so new items added are put to the top but im not really familiar with everything going on here as i followed a tutorial and i dont think they explained everything, ive added 4 screenshots to one image so you can see the anchors and components of each object in one image can anyone lend me a hand
Answer by Bilelmnasser · Sep 26, 2017 at 01:47 PM
you problem is here :
yeah i noticed theres actually 2 of them so ive fixed this but im still getting the same issue have a look at the screenshots ive added on @Thaun_ answer, thanks for your reply
Answer by hexagonius · Sep 24, 2017 at 05:36 PM
You should follow unity's official tutorials about their UI
Answer by Thaun_ · Sep 24, 2017 at 05:46 PM
The problem is in your Canvas. Change the UI Scale Mode into "Scale With Screen Size" and move the Match after your looks. I also reccomend to add Anchors.
ok turns out i was using 2 canvas scaler so i removed the one that doesnt use scale with screen size but i am using anchors and after removing the other canvas scaler im still no closer to solving this, anything else?
yeah sure attached is an image of how it looks in the inspector and if i change the size of the window the layout stretches to fit exactly as id like it too, the other image is how it looks on mobile where it doesnt reach the edges