Gallery.LayoutParams

译者署名: 我是谁

译者链接:http://blog.sina.com.cn/u/1744311365

翻译时间:2010.11.4

版本:Android 2.3 r1

 

结构

继承关系

public static class Gallery.LayoutParams extends ViewGroup.LayoutParams

        

java.lang.Object

android.view. ViewGroup.LayoutParams

android.widget.Gallery.LayoutParams

 

类概述

Gallery(画廊)扩展了LayoutParams,以此提供可以容纳当前的转换信息和先前的位置转换信息的场所。

 

补充

示例代码

1.  public View getView(int position, View convertView, ViewGroup parent)  

2.      {  

3.          ImageView imageView = new ImageView(mContext);  

4.              // 设置当前图像的图像(position为当前图像列表的位置)  

5.          imageView.setImageResource(resIds[position]);  

6.          imageView.setScaleType(ImageView.ScaleType.FIT_XY);  

7.          imageView.setLayoutParams(new Gallery.LayoutParams(163106));

8.          // 设置Gallery组件的背景风格  

9.          imageView.setBackgroundResource(mGalleryItemBackground);  

10.         return imageView;  

11.     }