how to set image layout param in Gallery in android -



how to set image layout param in Gallery in android -

i want utilize gallery in android in adapter class have set

@override public view getview(int arg0, view arg1, viewgroup arg2) { imageview iview = new imageview(ctx); iview.setimageresource(pics[arg0]); iview.setscaletype(imageview.scaletype.fit_xy); //iview.setlayoutparams(new gallery.layoutparams(150, 150)); iview.setlayoutparams(new gallery.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content)); homecoming iview; }

so overlap image, not show 1 one.

but if set

iview.setlayoutparams(new gallery.layoutparams(150,150));

then not overlap image image size increase.. have if want wrap content of image height width

thanks

look @ gallery doc: http://developer.android.com/reference/android/widget/gallery.html can utilize "setspacing" method on gallery object forcefulness images not overlap.

android gallery

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -