首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

ExpandableListView箭头右面显示方法

2012-09-20 
ExpandableListView箭头右边显示方法1首先 ExpandableListView elistview ? ? ? ?? elistview.setGroupIn

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;
??? }

热点排行