android - How to hide some controls in LIstview -
i have listview controls inside it. situation want hide few controls on particular "listview item" ..
you can either in getview()
or iterate through listview items , in particular item, use parent view operations on child views. if iteration make use of asynctask
.
something this:
private class ui extends asynctask <view, string, view> { public view viewitem=null; public ui(view v) { this.viewitem=v; } @override protected view doinbackground(view... arg0) { return viewitem; } @override protected void onpreexecute() { for(int = 0; <= listview.getlastvisibleposition(); i++) { if(listview.getchildat(i)!= null) { (listview.getchildat(i).findviewbyid(r.id.go)).setvisibility(view.gone); (listview.getchildat(i).findviewbyid(r.id.remove)).setvisibility(view.gone); } } super.onpreexecute(); } @override protected void onpostexecute(view result) { ((button)result.findviewbyid(r.id.go)).setvisibility(view.visible); ((button)result.findviewbyid(r.id.remove)).setvisibility(view.visible); super.onpostexecute(result); } }
Comments
Post a Comment