Focusable EditText inside ListView

后端 未结 13 2660
无人共我
无人共我 2020-11-21 23:56

I\'ve spent about 6 hours on this so far, and been hitting nothing but roadblocks. The general premise is that there is some row in a ListView (whether it\'s g

13条回答
  •  日久生厌
    2020-11-22 00:09

    The most important part is to get the focus working for the list cell. Especially for list on Google TV this is essential:

    setItemsCanFocus method of the list view does the trick:

    ...
    mPuzzleList = (ListView) mGameprogressView.findViewById(R.id.gameprogress_puzzlelist);
    mPuzzleList.setItemsCanFocus(true);
    mPuzzleList.setAdapter(new PuzzleListAdapter(ctx,PuzzleGenerator.getPuzzles(ctx, getResources(), version_lite)));
    ...
    

    My list cell xml starts like follows:

    
    

    nextFocusLeft/Right are also important for D-Pad navigation.

    For more details check out the great other answers.

提交回复
热议问题