Search Issue Tracker
Won't Fix
Votes
0
Found in
2018.4
2020.1.0b15
2021.1
Issue ID
1262578
Regression
No
[Android] [WebGL] "Constant Pixel Size" Canvas UI Scale Mode has no effect when changing screen orientation
Reproduction steps:
1. Download and open the user-submitted project "UnityWebGLGyroscope2.zip"
2. Build for WebGL
3. Create a server using this "python -m http.server" command in the Command Prompt
4. Navigate to the built WebGL page on your Android device using your IPV4 address
5. Change screen orientation to Landscape/Portrait
Expected result: The UI button size remains constant
Actual result: The UI button size changes based on screen orientation
Reproduces on: 2018.4.28f1, 2021.1.0a1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2021.1.X):
To ensure that the screen resolution remains consistent when the screen rotates, ensure that the page has a meta viewport tag. The default template creates an appropriate viewport tag by default with the code:
if (/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)) {
// Mobile device style: fill the whole browser client area with the game canvas:
var meta = document.createElement('meta');
meta.name = 'viewport';
meta.content = 'width=device-width, height=device-height, initial-scale=1.0, user-scalable=no, shrink-to-fit=yes';
document.getElementsByTagName('head')[0].appendChild(meta);
...