Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Android Softkeyboard hides the bottom most TextView?

Tags:

android

This is the layout file of my Fragment.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <!-- android:fillViewport="true" -->

    <EditText
        android:id="@+id/chatDispWindow"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/chatTypeWindow"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="9dp"
        android:layout_marginRight="6dp"
        android:background="@color/background_color"
        android:clickable="false"
        android:cursorVisible="false"
        android:focusable="false"
        android:focusableInTouchMode="false"
        android:gravity="bottom"
        android:inputType="textMultiLine|textLongMessage|textNoSuggestions"
        android:scrollHorizontally="true" />
    <!-- android:hint="@string/groupChatDispMsg" -->

    <ImageButton
        android:id="@+id/sendBtn"
        android:layout_width="52dp"
        android:layout_height="46dp"
        android:layout_above="@+id/chatStatusWindow"
        android:layout_alignBottom="@+id/chatTypeWindow"
        android:layout_alignParentRight="true"
        android:layout_marginBottom="-3dp"
        android:layout_marginLeft="4dp"
        android:background="@drawable/send_chatbtn_selector"
        android:contentDescription="@string/sendLbl" />

    <EditText
        android:id="@+id/chatTypeWindow"
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:layout_above="@+id/chatStatusWindow"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="6dp"
        android:layout_toLeftOf="@+id/sendBtn"
        android:background="@drawable/editbox_selector"
        android:imeActionId="@+id/sendChatImeBtn"
        android:imeActionLabel="@string/sendLbl"
        android:imeOptions="actionSend"
        android:inputType="textMultiLine"
        android:minHeight="45dp" />
    <!-- android:hint="@string/chatWindowMsg" -->

    <TextView
        android:id="@+id/chatStatusWindow"
        android:layout_width="match_parent"
        android:layout_height="15dp"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="3dp"
        android:layout_marginLeft="9dp" />
    <!-- android:text="@string/chatStatusMsg" -->

</RelativeLayout>

This is the behaviour of the App now...

Default View Ui When User clicks on the EditText

Problem is the keyboard hides the bottom most TextView of the Screen, How can I make that visible even if the Keyboard is showing ?

I have tried using android:windowSoftInputMode="adjustResize" but its not working. please help,

EDIT After further digging in I came to know that if I remove the Full Screen Theme then android:windowSoftInputMode="adjustResize works perfectly. How I can get that with FullScreen Theme ?

like image 859
Amit Avatar asked Jan 28 '26 11:01

Amit


1 Answers

Try out this in manifest file under your activity

android:windowSoftInputMode="adjustPan"
like image 150
Sanket Pandya Avatar answered Jan 30 '26 02:01

Sanket Pandya