Set a background color to a selected ListView Item in android

后端 未结 7 1606
甜味超标
甜味超标 2020-12-15 23:29

I have a listview which displays several items. Now I want to scroll to some specific item (e.g. the 33th item). I know that this can be done via

myList.setS         


        
7条回答
  •  臣服心动
    2020-12-15 23:39

    Try this, it will work-

    myList.getChildAt(myList.getSelectedItemPosition()).setBackgroundColor(Color.RED);
    

提交回复
热议问题