ExpandableListView 判断是否展开

来源:互联网 发布:网络外宣是什么 编辑:程序博客网 时间:2024/04/27 20:28
 
@Overridepublic View getGroupView(int i, boolean b, View view, ViewGroup viewGroup) {    if (view == null) {        LayoutInflater inflater = (LayoutInflater) mContent.getSystemService(Context.LAYOUT_INFLATER_SERVICE);        view = inflater.inflate(R.layout.parent_item, null);    }    view.setTag(R.layout.parent_item, i);    view.setTag(R.layout.child_item, -1);    TextView textView = (TextView) view.findViewById(R.id.tv_grade);    textView.setText(data.get(i).getGradeName());    FrameLayout frameLayout = (FrameLayout) view.findViewById(R.id.flayout);       if (b){             frameLayout.setBackgroundResource(R.drawable.controls_tableview_groupbackground_expand);     }else{         frameLayout.setBackgroundResource(R.drawable.controls_tableview_groupbackground_collapse);     }    return view;}

原创粉丝点击