Is this is OK to use the ListView for inline editing?

前端 未结 3 1579
忘掉有多难
忘掉有多难 2020-12-22 02:49

EDIT:

I can\'t write into the EditText, it disappears when i try to write something, its because the getView() is called when i mod

相关标签:
3条回答
  • 2020-12-22 03:27

    Why not? It would be definitely nice for user, but kind of tricky to develop.

    • Your list entry layout must provide text edit ( maybe invisible ) and switch to it on click on text view. This text view shall have suitale listener keeping track in parent layout etc.
    • you have to save data back as soon as textedit loses focus / about to being reclaimed by list view for reuse in cause fo scrolling.
    0 讨论(0)
  • 2020-12-22 03:30

    Ok, Its my personal opinion.. try if you like it..

    1. Fill data in your list from database. (No need of EditText in layout).

    2. Make a dialog with Edittext. Now when user click on ListItem open that dialog with pre-populated text from current selected list row textview. Then allow user to change in it. When user click OK on dialog then modify that Textview in list item..

    0 讨论(0)
  • 2020-12-22 03:50

    @yaqub use EditorActionListener with imeOptions="actionDone" like

    1. set the android:imeOptions="actionDone" property for edittext which is there in list.
    2. use editText.setOnEditorActionListener(onEditorActionListener)
    3. track if(actionId == EditorInfo.IME_ACTION_DONE) {//here do your action}
    0 讨论(0)
提交回复
热议问题