Tuesday, 10 December 2019

Automatically resize ScrollView when keyboard is opened on Android/iOS

I've seen countless topics about this, but as for now I cannot find anything working. I have portrait app with a form containing mostly input fields.

I've created a ScrollView and inside content I've added all necessary fields. I've added Vertical Layout Group and Content Size Fitter. Now, when I run the app, content moves nicely, but when I open keyboard it overlaps the content and I cannot see lower input fields when editing them. It doesn't look well. So, I'm looking for a script/plugin to enable this feature for both android and iOS. I've only seen iOS-specific solutions and universal, but none worked for me. I can link all the codes I've found, but I think it'll just create an unnecessary mess. Most of these topics are old and may have worked before, but doesn't work now.

Ideally, I'd prefer a global solution, which just shrinks whole app, when keyboard is opened and expands it back, when keyboard is closed.

Btw. I'm using Unity 2019.2.15f1 and running on Pixel 3XL with Android 10, if that matters.



from Automatically resize ScrollView when keyboard is opened on Android/iOS

No comments:

Post a Comment