Soft Keyboard Hide ActionBar when using adjustPan

I need to set all these three elements visible
1. ActionBar
2. ListView
3. EditText (bottom)
When I click on EditText , it pushes the background image and compresses it. I saw a few lessons and used android:windowSoftInputMode="adjustPan" , which solved the compression problem, but created a new one. When SoftKeyboard appears, it also hides the ActionBar . I visited a lot of questions, but none of them were really helpful. Is there a way to set the ActionBar always visible , no matter what happens on the screen, etc.

EDITED

xml fragment used to display the ListView and EditText is:

 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/RelativeLayout1" android:layout_width="match_parent" android:layout_height="match_parent" > <ListView android:id="@id/android:list" style="@style/ContactListView" android:layout_width="match_parent" android:layout_height="389dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:isScrollContainer="false" /> <TextView android:id="@id/android:empty" android:layout_width="match_parent" android:layout_height="80dp" android:layout_above="@+id/editText1" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:fontFamily="sans-serif-light" android:gravity="center" android:text="@string/no_contacts" android:textAppearance="?android:attr/textAppearanceLarge" /> <EditText android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentBottom="true" android:background="@android:color/holo_blue_dark" android:ems="10" android:imeOptions="flagNoExtractUi"/> </RelativeLayout> 

Edited (2nd)

Pictures:

enter image description hereenter image description here

+6
source share
3 answers

I have the same problem as you have with EditText inside the Relative layout, before after searching several streams all over the Internet I failed, but I solve this by experimenting with it by adding bottom_padding to EditText which fixed it.

+2
source

Try using android:windowSoftInputMode="adjustResize|stateHidden" in your activity tag.

+4
source

try this code to display file and activity to change layout. Android: windowSoftInputMode = "stateAlwaysVisible | stateHidden"

0
source

Source: https://habr.com/ru/post/970924/


All Articles