Search code examples
javaandroid-studioandroid-layoutandroid-listviewandroid-softkeyboard

Stop adjusting size of ListView when keyboard is Active.[with images]. Android studio


View without keyboard

View with keyboard. The keyboard is on the background of the search view. It irritates user.

I don't want to come up listview every time I open the keyboard. As you see from the second image, listview under search view is annoying for the user. When keyboard is not active, all is ok.

I tried android:windowSoftInputMode="stateVisible" android:windowSoftInputMode="adjustResize" adjustPan and adjustNothing Nothing works.


Solution

  • The issue was in ConstraintLayout. I switched my view to RelativeLayout! Then, I put each element regarding.

    Now, no overlap not as in Constraint Layout.

    Explanation: ConstraintLayout sets Elements by padding. RelativeLayout sets Elements relatively to each other.