I am making an app that needs to create a Registration Form to take user inputs. For inputs I have 4 fields. I adjusted 4 fields in UIStackView
and made stakeview vertically centered as it was a design of app. Everything is going good. but in small devices Keyboard was over lapping some fields.
To solve my problem I did R&D and used IQKeyboardManager
. It helped me a lot. but I have seen that in fields all you can go to other fields you have to use toolbar provided by IQKeyboardManager
. But now a days in advance app you can see you can scroll the view up and down.
What I have done:
So To solve my problem I created a UIScrollView
around my stackview that contains my fields but it never helped me. Because it is creating design issues also. Stackview never comes in vertically centered of ScrollView. also scrollview is enabled all the time regardless of keyboard is appeared or not. look at following picture that dipicts me UI
What I want:
All I want is that untill and unless Keyboard is appeared scrollview should not be scrollable. Once the keyboard is appeared then the scrollview must be scrollable. Also I want to check if there is need to make scrollview scrollable or not. Because in larger devices like iPhone 8plus I think there is no need to show scrollview as keyboard is always below the last UITextfield
. Its just overlapping in smaller phone like iPhone 5.
Please help me. It is my idea that apps are using scrollview. They may be using something other that act lik scrollview aroung views when Keyboard is open and does not show any scrollview when there is no keyboard open.