Currently, I have a UICollectionView
, which multiple rows of UITextField
.
When the bottom UITextField
, keyboard will block its visibility.
To make UICollectionView
still scrollable to bottom, many techniques have been intoriduced
- How do I scroll the UIScrollView when the keyboard appears?
- How can I make a UITextField move up when the keyboard is present - on starting to edit?
- Third party library https://github.com/hackiftekhar/IQKeyboardManager
Most solution ideas are
- Calculate the high of keyboard.
- Adjust the
contentInset
andscrollIndicatorInsets
ofUICollectionView
However, such solution doesn't work very well, if my screen is consists of a UICollectionView
and a bottom UIView
.
When keyboard is hidden
--------------------
| |
| |
| |
| |
| UICollectionView |
| |
| |
| |
| |
--------------------
| |
| Custom UIView |
| |
--------------------
When keyboard is shown (My expectation)
--------------------
| |
| |
| UICollectionView |
| |
| |
--------------------
| |
| Custom UIView |
| |
--------------------
| |
| |
| Keyboard |
| |
--------------------
However, current provided solution, is only able to "push up" UIScrollView
/ UICollectionView
.
I tend to "push up" entire main UIView
. Unfortunately, UIView
doesn't have contentInset
for me to act upon, based on keyboard height.
This is my current outcome using https://github.com/hackiftekhar/IQKeyboardManager. The outcome is the same, if I apply solution from https://stackoverflow.com/a/32353069/72437
When keyboard is hidden
When keyboard is shown. Only UICollectionView is being pushed up. The bottom UIView
will be "covered"
Any idea how I can "push up" entire app screen, instead of just UICollectionView
/ UIScrollView
?