我怎样才能添加更多相同的布局而不是一个
View v = (LinearLayout) inflater.inflate(R.layout.tab_frag2_layout,container, false);
RelativeLayout tv = (RelativeLayout) inflater.inflate(R.layout.post_layout,container,false);
RelativeLayout tv2 = (RelativeLayout) inflater.inflate(R.layout.post_layout,container,false);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv);
如果我这样做它会给我错误然后如果我这样做它只会显示一次
View v = (LinearLayout) inflater.inflate(R.layout.tab_frag2_layout,container, false);
RelativeLayout tv = (RelativeLayout) inflater.inflate(R.layout.post_layout,container,false);
RelativeLayout tv2 = (RelativeLayout) inflater.inflate(R.layout.post_layout,container,false);
((LinearLayout) v).addView(tv);
((LinearLayout) v).addView(tv2);
怎么办请帮忙