Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: How to change height of ListView dynamically whenever the phone's keyboard pops up or goes down?
    primarykey
    data
    text
    <p>I have made an application which lets user chat. For showing the chat messages I am using ListView to display the messages in List items. I want the ListView to adjust accordingly whenever the keyboard pops up or goes down.</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orientation="horizontal"&gt; &lt;EditText android:id="@+id/message_edittext" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="0dp" android:ems="10" android:hint="Enter your message..." android:maxLength="20" android:paddingLeft="22dp" /&gt; &lt;ImageButton android:id="@+id/send_btn" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_alignParentRight="true" android:layout_marginRight="10dp" android:background="@drawable/ok"/&gt; &lt;/RelativeLayout&gt; &lt;ListView android:id="@+id/message_listView" android:layout_width="match_parent" android:layout_height="300dp" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:stackFromBottom="true"&gt; &lt;/ListView&gt; &lt;/RelativeLayout&gt; </code></pre> <p><img src="https://i.stack.imgur.com/xzx2m.png" alt="enter image description here"> The listview should occupy the whole screen whenever the keyboard goes down and it should go up above the keyboard whenever user begins typing.<br> <img src="https://i.stack.imgur.com/8j6cv.png" alt="enter image description here"></p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload