我在获取布局宽度时遇到问题...添加新视图后它没有返回实际宽度?...我该如何解决...谢谢...这是我的示例代码。
llDayHeaderTable = (LinearLayout) viewGroup
.findViewById(R.id.llDayHeaderTable);
LayoutInflater vi = (LayoutInflater) parent
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
for (View v : vTmp) {
llDayHeaderTable.removeView(v);
}
vTmp.removeAllElements();
for (int i = 0; i < dto.arrProductTitleList.size(); i++) {
String productName = dto.arrProductTitleList.get(i).productInfoName;
vItemHeader = vi.inflate(R.layout.layout_kpi_sku_group_accum_item,
null);
TextView tv = (TextView) vItemHeader
.findViewById(R.id.tvHeaderProduct);
tv.setText("" + productName);
llDayHeaderTable.addView(vItemHeader);
vTmp.add(vItemHeader);
}
int width = llDayHeaderTable.getWidth();