Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Soft Keyboard Hiding ActionBar while using adjustPan

I need to set visible all these three items
1. ActionBar
2. ListView
3. EditText (at Bottom)
When i click on EditText, it pushed the background image and squeezed it. i saw some tutorials and used android:windowSoftInputMode="adjustPan" that solved the squeezing issue but created a new one. When the SoftKeyboard appears, it also hides the ActionBar. I have visited many questions , but none of them was actually helpfull. IS there any way to set ActionBar always visible whatever happening on screen etc...

EDITED

The xml of 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)

Snapshots are:

enter image description hereenter image description here

like image 351
BST Kaal Avatar asked Jun 17 '14 07:06

BST Kaal


2 Answers

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

like image 195
codezjx Avatar answered Oct 14 '22 18:10

codezjx


I have the same problem as yours with EditText inside a Relative layout before, after searching several thread all over internet I have failed, but I solve it by experimenting on it through adding bottom_padding to the EditText which fixed it.

like image 27
Rod_Algonquin Avatar answered Oct 14 '22 17:10

Rod_Algonquin