ListView的SimpleAdapter

SimpleAdapter adapter = new SimpleAdapter{

this,//父容器

list,//数据源

R.layout.item,//行布局

new String[]{"logo", "title", "version", "size"},//数据源List<Map>中,Map的键

new int[]{R.id.logo, R.id.title, R.id.version, R.id.size}//行布局中,每个控件的id

}

Bug处理:当ListView布局中出现按钮时,会出现按钮抢夺了行的点击事情,导致点击行后无响应。这时需要设置descendantFocusability=“blockDescendants",使行能够获得焦点

猜你喜欢

转载自www.cnblogs.com/xxie12/p/11484268.html