RelativeLayout.LayoutParams params=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,50);
params.setMargins(0,14,0,0);
viewHolder.root.setLayoutParams(params);
也可以
<pre name="code" class="java">if(moreListDto.getTitle().equals("")){
convertView=inflater.inflate(R.layout.list_more_null,parent,false);
TextView title1 = (TextView) convertView.findViewById(R.id.tv_txt1);
title1.setText("");
return convertView;
}