注意: inflate时传入parent否则可能计算高度有误在Android 4.3系统下发现的。
rowView = inflater.inflate(R.layout.list_items_user, parent, false);
for (int i = 0; i < listView.getCount(); i++) {
View listItem = adapter.getView(i, null, listView);
listItem.measure(0, 0);
totalHeight += listItem.getMeasuredHeight();
}
//加上分割线高度
totalHeight += (listView.getDividerHeight() * (adapter.getCount() - 1));