LinearLayout无限添加View怎么报错啊! linearLayout.addView(childLayout);这句运行第二次久报错
Viewlayout=LayoutInflater.from(this).inflate(R.layout.brand_story_list,null);intwidth...
View layout = LayoutInflater.from(this).inflate(R.layout.brand_story_list, null);
int width = 94;
int height = _layout_story_init.getHeight();
View childLayout = LayoutInflater.from(BrandStoryActivity.this).inflate(R.layout.story_childlist, null);
_lv_listStory = (ListView) layout.findViewById(R.id.lv_story_brand);
LinearLayout linearLayout=(LinearLayout)layout.findViewById(R.id.layout_child_add);
_lv_listStory.setAdapter(new StroyListAdapter(list, this));
Map<String, Object> map=list.get(0);
int scop=1;
while (map!=null) {
scop++;
List<Map<String, Object>> listmap=(List<Map<String, Object>>) map.get("submenu");
linearLayout.addView(childLayout);
ListView lv_story_childlist=(ListView)layout.findViewById(R.id.lv_story_childlist);
lv_story_childlist.setAdapter(new StroyListAdapter(listmap, BrandStoryActivity.this));
map=listmap.get(0); 展开
int width = 94;
int height = _layout_story_init.getHeight();
View childLayout = LayoutInflater.from(BrandStoryActivity.this).inflate(R.layout.story_childlist, null);
_lv_listStory = (ListView) layout.findViewById(R.id.lv_story_brand);
LinearLayout linearLayout=(LinearLayout)layout.findViewById(R.id.layout_child_add);
_lv_listStory.setAdapter(new StroyListAdapter(list, this));
Map<String, Object> map=list.get(0);
int scop=1;
while (map!=null) {
scop++;
List<Map<String, Object>> listmap=(List<Map<String, Object>>) map.get("submenu");
linearLayout.addView(childLayout);
ListView lv_story_childlist=(ListView)layout.findViewById(R.id.lv_story_childlist);
lv_story_childlist.setAdapter(new StroyListAdapter(listmap, BrandStoryActivity.this));
map=listmap.get(0); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询