android中文api(80)——Gallery.LayoutParams
正文 一、结构 public static classGallery.LayoutParams extendsViewGroup.LayoutParams java.lang.Object android.view. ViewGroup.LayoutParams android.widget.Gallery.LayoutParams 二、类概述 Gallery(画廊)扩展了LayoutParams,以此提供可以容纳当前的转换信息和先前的位置转换信息的场所。 三、补充 publicViewgetView(intposition,ViewconvertView,ViewGroupparent) { ImageViewimageView=newImageView(mContext); //设置当前图像的图像(position为当前图像列表的位置) imageView.setImageResource(resIds[position]); imageView.setScaleType(ImageView.ScaleType.FIT_XY); imageView.setLayoutParams(newGallery.LayoutParams(163,106)); //设置Gallery组件的背景风格 imageView.setBackgroundResource(mGalleryItemBackground); returnimageView; } 本文转自over140 51CTO博客,原文链接:http://blog.51cto.com/over140/582439,如需转载请自行联系原作者