首页 > 其他 > 详细

Listview 点击获取view

时间:2014-07-01 22:45:23      阅读:460      评论:0      收藏:0      [点我收藏+]

listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {

ViewGroup vg = (ViewGroup) listview;
int count = vg.getChildCount();
Log.v("position",String.valueOf(position));
for (int i = 0; i < count; i++) {

View v1 = vg.getChildAt(i);
LinearLayout llyout = (LinearLayout)v1.findViewById(R.id.linearLayout2);
if(i==position)
{

llyout.setVisibility(View.VISIBLE);

GridView gvson = (GridView)v1.findViewById(R.id.gdv_son);

}else{

llyout.setVisibility(View.GONE);
}

}
}
});

Listview 点击获取view,布布扣,bubuko.com

Listview 点击获取view

原文:http://www.cnblogs.com/lucoo/p/3816567.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!