Code example for Gallery.LayoutParams

0
            ImageView i = new ImageView(mContext);
 
            i.setImageResource(mThumbIds[position]);
            i.setAdjustViewBounds(true);
            i.setLayoutParams(new Gallery.LayoutParams(
                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
            //i.setBackgroundResource(R.drawable.picture_frame); 
            return i;
        } 
 
        private Context mContext;
         
        private Integer[] mThumbIds = {
                R.drawable.sample01thumb, R.drawable.sample02thumb, 
                R.drawable.sample03thumb, R.drawable.sample04thumb,  
                R.drawable.sample05thumb, R.drawable.sample06thumb}; 
 
        private Integer[] mImageIds = {
                R.drawable.sample01, R.drawable.sample02, 
                R.drawable.sample03, R.drawable.sample04,  
Experience pair programming with AI  Get Codota for Java