Ahmet Kazaman February 2016

Change size of Listview when closing or opening Softkeyboard

How can I expand my Listview when I close the Softkeyboard or open it again ? My Listview is currently full screened.

Problem: When I want to scroll to the last item of my ListView I have to close Softkeyboard first because the Softkeyboard is hiding it (so its under the softkeyboard) , and thats kinda annonying.

I found an example ,what I want to achieve, in the android music player search function which looks like this when I open and close it (See scrollbars)

When Softkeyboard is closed When its opened

Is there a way without much hacks ? I allready tried this in my manifest :

android:windowSoftInputMode="adjustResize"

but this didnt helped.

EDIT: My Layout:

    <?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:orientation="vertical"
    android:background="@drawable/listview_background">

    <RelativeLayout
        android:id="@+id/RelativeLayout1"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@color/colorPrimary"
        android:orientation="vertical" >

        <EditText
            android:id="@+id/editText_searchbox"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_toRightOf="@+id/imageView_btn_back"
            android:ems="10"
            android:hint=" Search"
            android:singleLine="true"
            android:textColor        

Answers


Ahmet Kazaman February 2016

With zgc7009 help I found out that the adjustResize only works when the layout is NOT in fullscreen mode. That solved everything by changing my AppTheme style.

If someone knows how to use adjustResize with fullscreen mode let me pls know.

Thanks again to zgc7009 !

Post Status

Asked in February 2016
Viewed 2,296 times
Voted 12
Answered 1 times

Search




Leave an answer