I have an activity with a form in it. Because the form is quite long, I've used a scrollview.
The problem is that the scrollview doesn't change when the keyboard is up. The keyboard overlaps the last part of the scrollview.
How can I make sure that the keyboard is below the scrollview and the scrollview is adjusted to fit the space above it?
In the meanwhile, is there a way to make sure the buttons ‘previous’ and ‘next’ are in the keyboard as well?
Handling the Keyboard Appearing Notification There are two things to do in keyboardWasShown to scroll the text view. First, set the text view's content inset so the bottom edge is the keyboard's height. Second, set the scroll indicator insets to the text view's content inset.
ScrollView and HorizontalScrollView has same attributes, the only difference is scrollView scroll the child items in vertical direction while horizontal scroll view scroll the child items in horizontal direction.
ScrollView is used to put different or same child views or layouts and the all can be scrolled. ListView is used to put same child view or layout as multiple items. All these items are also scrollable. Simply ScrollView is for both homogeneous and heterogeneous collection.
In the application's manifest file, add the following to the desired <activity />
--
android:windowSoftInputMode="stateAlwaysHidden|adjustResize|adjustPan"
You need to add android:windowSoftInputMode="adjustResize" in the AndroidManifest.xml file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With