ExpandableListView箭頭右邊顯示方法
1首先 ExpandableListView elistview;
elistview.setGroupIndicator(null);//將控制元件預設的左邊箭頭去掉,
2在 自定義的繼承自BaseExpandableListAdapter的adapter中有一個方法
/**
* 父類view
*/
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent) {
Log.i("zhaoxiong","parent view");
LinearLayout parentLayout=(LinearLayout) View.inflate(context, R.layout.wowocoupons_parent_item, null);
TextView parentTextView=(TextView) parentLayout.findViewById(R.id.parentitem);
parentTextView.setText(parentlist.get(groupPosition));
ImageView parentImageViw=(ImageView) parentLayout.findViewById(R.id.arrow);
//判斷isExpanded就可以控制是按下還是關閉,同時更換圖片
if(isExpanded){
parentImageViw.setBackgroundResource(R.drawable.arrow_down);
}else{
parentImageViw.setBackgroundResource(R.drawable.arrow_up);
}
return parentLayout;
}