java - Android gridview change backgound by position -


i have gridview images. above image have text(hello) , can show images(without text) gridview .now want if click gridview's 5th element want hide 5th image's text.meybe problem solution gridview.setonitemclicklistener not know how can wrote code witch can show toast message position,but not know how can hide text position

gridview.setonitemclicklistener(new onitemclicklistener() {         @override         public void onitemclick(adapterview<?> parent, view v,                 int position, long id) {                 toast.maketext(getapplicationcontext(), "cliked" + position,                     toast.length_short).show();          }     }); 

you try setvisibility along array sort through gui identifiers:

    int textid = this.getresources().getidentifier(position, "id", this.getpackagename());      textview pictext = (textview) findviewbyid (r.id.textid);     pictext.setvisibility(textview.invisible); 

or that. invisible makes invisible, take same space - gone make space disappear - depending on want.

that should @ least in right direction.

for more: http://developer.android.com/reference/android/view/view.html#setvisibility(int)


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -