Domanda

I have an activity with a text-view, 2 edit-text and a list-view all in vertical orientation, here list work as a auto suggestion list when we type in either of the edit-text, now the problem is when the list is populated with the suggestion result it always remain below the soft-keyboard i.e., if we have to check and select the result then we first have to hide the keyboard. Is there any way to pushup the activity layout so that list is visible only if it contains something I tried android:windowSoftInputMode="stateAlwaysHidden|adjustResize" also but it doesn't help me :(

Please help.

È stato utile?

Soluzione 2

As suggested in problem Push up content when clicking in edit text, I also able to solve my problem by hiding/showing the view just above edit-text with soft-keyboard open/close event respectively. By doing so, I had enough space there to show the suggestion list even the soft-keyboard is in open mode. It appears as is tricky solution in my case too...

Altri suggerimenti

We can use linearlayout to ajust.

Try this code:

Activity:

android:windowSoftInputMode="adjustResize"

Layout:

  <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />
    </LinearLayout>

    <ListView
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >
    </ListView>
   </LinearLayout>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top