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
- [VFX] Incorrect Behavior with SG and Scale in Update
- Memory leaks are caused when using MeshToSDFBaker.Dispose()
- [iOS][Android] Crash on 'EXC_BAD_ACCESS' when trying to create a Joint with script in build
- Particles are drawn upside down when using Camera.RenderToCubemap
- "Find References In Project" gives inaccurate results when Prefab Variant Parent default Object references are changed
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);
...