Android EditText in ListView - keyboard

前端 未结 2 1821
太阳男子
太阳男子 2020-12-30 01:14

I\'ve got a problem with my EditText. I use the following adapter:

public class RowTextViewAdapter extends BaseAdapter {

...

  public View get         


        
相关标签:
2条回答
  • 2020-12-30 01:45

    some times when you use android:windowSoftInputMode="stateAlwaysHidden"in manifest activity or xml, that time it will lose keyboard focus. So first check for that property in your xml and manifest,if it is there just remove it. After add these option to manifest file in side activity android:windowSoftInputMode="adjustPan"and add this property to listview in xml android:descendantFocusability="beforeDescendants"

    0 讨论(0)
  • 2020-12-30 02:00

    If this is still an issue, take a look at this item: Focusable EditText inside ListView

    This changes may help.

    Change to listview:

    <ListView
        android:id="@android:id/list" 
        android:layout_height="fill_parent" 
        android:layout_width="fill_parent"
        android:descendantFocusability="beforeDescendants"
        />
    

    Change to activity in mainfest.xml:

    <activity android:name= ".yourActivity" android:windowSoftInputMode="adjustPan"/>
    
    0 讨论(0)
提交回复
热议问题