03 December 2014

Android开发 动态设定listview行高

the problem is that you are mis-using the inflator, don’t give null as the root node

if you pass null as the root node, all the size parameters you set in the xml fail to work

the correct code is

view = inflater.inflate(R.layout.lview_row, parent, false);

这样item.xml在布局中定义的height就会起作用。



blog comments powered by Disqus