簡體   English   中英

如何更改不再出現在屏幕上的可擴展列表視圖子項的背景

[英]How to change the background of an expandable list view child that is not on screen anymore

在 setOnChildClickListener 中,我可以使用v.setBackgroundResource(R.color.blue); (我不能使用Z0F635D0E0F3874FF58B581C132E6C7A7Z列表項目選擇器,因為我正在做一些分屏屏幕,並且焦點丟失了)我也能夠在選擇另一個孩子時將顏色設置回顏色。 However, when a selected child is scrolled off screen, it does not go back to the original color and when a parent is collapsed, if a child inside that parent was selected, it will hop down to the next parent and change the background of a因為根據 android 折疊的行不再存在,所以那里的孩子。 有關如何修復這些錯誤的任何提示?

您需要存儲選擇了哪個項目,然后制作一個自定義適配器,該適配器在其 getView() 方法中返回具有適當背景的視圖

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM