我试图删除我设置的页脚使用我用来设置它的相同参考.然而,没有任何反应.
protected voID onPostExecute(ArrayList<Recipe> result) { int CHEF_ID = ChefsRecipeList.this.getIntent().getIntExtra("CHEF_ID", 0); ListVIEw recipeListVIEw = (ListVIEw)findVIEwByID(androID.R.ID.List); VIEw footer = getLayoutInflater().inflate(R.layout.chef_recipe_List_footer, null); if(!addToExisting){ RecipeManager.getInstance().setRecipeList(result); VIEw header = getLayoutInflater().inflate(R.layout.chef_recipe_List_header, null); ImageVIEw loadbutton = (ImageVIEw)footer.findVIEwByID(R.ID.loadmore); loadbutton.setonClickListener( new OnClickListener() { @OverrIDe public voID onClick(VIEw v) { int CHEF_ID = ChefsRecipeList.this.getIntent().getIntExtra("CHEF_ID", 0); try { Log.d("NXTLAOD", "http://API.foodnetworkasia.com/API/mobile/get_recipes?chefID="+ChefManager.getInstance().getChef(CHEF_ID).getID()+ "&format=xml&startIndex="+(RecipeManager.getInstance().getRecipeList().size()+1)+"&endindex="+(RecipeManager.getInstance().getRecipeList().size()+24)); new XMLRecipesParser(true).execute(new URL[] { new URL("http://API.foodnetworkasia.com/API/mobile/get_recipes?chefID="+ChefManager.getInstance().getChef(CHEF_ID).getID()+ "&format=xml&startIndex="+RecipeManager.getInstance().getRecipeList().size()+"&endindex="+(RecipeManager.getInstance().getRecipeList().size()+24)) } ); } catch (MalformedURLException e) { // Todo auto-generated catch block e.printstacktrace(); } } }); ImageVIEw chefPhoto = (ImageVIEw)header.findVIEwByID(R.ID.chef_photo); chefPhoto.setimageBitmap(ImageURLLoader.LoadImageFromURL(ChefManager.getInstance().getChef(CHEF_ID).getLargeURL())); TextVIEw chefBio = (TextVIEw)header.findVIEwByID(R.ID.chef_bio); chefBio.setText(ChefManager.getInstance().getChef(CHEF_ID).getDescription()); recipeListVIEw.addheaderVIEw(header); recipeListVIEw.addFooterVIEw(footer); recipeListVIEw.setAdapter(new RecipeAdapter(ChefsRecipeList.this)); }else{ RecipeManager.getInstance().mergeLists(result); RecipeAdapter wrapperAdapter=(RecipeAdapter) ((headerVIEwlistadapter)recipeListVIEw.getAdapter()).getWrappedAdapter(); wrapperAdapter.notifyDataSetChanged(); } if(totalRecipes == RecipeManager.getInstance().getRecipeList().size()){ recipeListVIEw.removeFooterVIEw(footer); Log.d("FOODREM", "Footer Removed"); } Log.d("ITCOUNT", totalRecipes+"-"+RecipeManager.getInstance().getRecipeList().size()); updateItemscount(); }}
解决方法:
您可能必须调用ListVIEw1.setAdapter(适配器)来@R_169_6419@视图.如果这不起作用,另一种解决方案是将页脚视图的高度设置为0px.如果您计划稍后再次使用页脚视图,这是一个更好的解决方案.
总结以上是内存溢出为你收集整理的android – 使用removeFooterView()删除ListView页脚的问题全部内容,希望文章能够帮你解决android – 使用removeFooterView()删除ListView页脚的问题所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)