![](/img/trans.png)
[英]How to make child in ExpandableListView a textbox instead of a list for Android?
[英]Android: How to make child rows in ExpandableListView non-cklickable?
猜猜這很簡單,但是搜索沒有幫助...
我想要一個ExpandableListView,在其中您不能選擇子行。
我試圖將選擇器設置為“透明”,但它仍然更改了文本顏色,因此您會注意到已單擊。
親切的問候,水母
如果您來不及,但希望對您有所幫助。
您必須在適配器中實現此方法:
public class MyExpandableAdapter extends BaseExpandableListAdapter {
@Override
public boolean isChildSelectable(int arg0, int arg1) {
// Al childs items, If you want some active items have to specify their indices and return true or false
return false;
}
// With all other methods
...
}
您是否嘗試在子視圖上添加setFocusable(false)參數? 還將文本顏色更改為黑色。 默認情況下有一個選擇器,黑色時默認為白色。 因此基本上將子視圖的每種顏色更改為不可選擇的顏色。
我意識到,在大多數Android應用程序(例如,我自己手機上的設置)中,即使事后沒有任何動作,顯然也沒有人願意關掉“ click”動畫。 因此,我決定也就這樣離開。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.