The UI Button Hitbox changes after using a Input Field on Android
Hey, i came across the following error.
I have a Button and an Input Field inside of an App, it is build with Unity to an Android Phone (Samsung Galaxy S8+). The Button works as expected until i want to insert Text in the Input Field. The Smartphone Keyboard will open -> type something in -> close the keyboard. Suddenly the Hitbox of the Button moved towards the top (around 1cm). I tried to fix this multiple times already but so far i could not find any solution. Logging the Position of the Button and Button Image show no difference, nothing is "really" moving. This Error can't be reproduced in the Editor or on a iOS Device. Any Ideas?!
Answer by UhlmannVincent · Dec 18, 2018 at 09:22 AM
Hey, we were able to "fix" it by removing any "Screen.SetResolution(Screen.width, Screen.height, false);" in the code. We are in contact with Unity's Support and created a Bug Ticket but in the meantime this should do it for you (at least it did for us :D)!