2013-10-09 44 views
0

我在我的主要活動中使用列表如何在android中自定義列表?

我不想使用android list,我想創建自己的列表,我已經創建了自定義Adapter,使我可以使用圖像和文本列表中的任何行,但我要禁用列表中的分頻器和懸停模式

它的意思是,我不希望有這樣的事情PIC

這不是我的項目截圖

enter image description here

在此先感謝,

回答

0

既然你已經有了自己的CustomListAdapter,做你的onCreate()方法如下:

ListView list=(ListView)findViewById(R.id.list); //or whatever the id of your listview is 

// Getting adapter by passing xml data ArrayList 
YourCustomAdapter adapter = new YourCustomAdapter(this, listDataToBeDisplayed); 
list.setAdapter(adapter); 
1
在適配器

,覆蓋的方法isEnabled(int position),並有用於這項商品返回false。

+0

如果我可以選擇兩個答案接受這個答案是他們中的一個,我的問題必須分開,這是禁用懸停模式的答案 –

0

嘗試下面的代碼來禁用的亮點,你可以改變文字顏色以及

ListView.setSelector(new ColorDrawable(Color.TRANSPARENT)); 
相關問題