您的位置:首页 > 移动开发 > Android开发

android中文api(80)——Gallery.LayoutParams

2010-12-28 10:11 141 查看
前言

  本章内容是 android.widget.Gallery.LayoutParams,版本为Android 2.3 r1,翻译来自"我是谁",欢迎大家访问他的博客:http://blog.sina.com.cn/u/1744311365,再次感谢"我是谁" !期待你加入Android 中文API的翻译,联系我over140@gmail.com。

声明

  欢迎转载,但请保留文章原始出处:)

    农民伯伯:http://over140.blog.51cto.com/

    Android中文翻译组:http://code.taobao.org/project/view/404/

正文

  一、结构

public static class Gallery.LayoutParams extends ViewGroup.LayoutParams

java.lang.Object
android.view. ViewGroup.LayoutParams
android.widget.Gallery.LayoutParams

  二、类概述

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

  三、补充

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

{

ImageView imageView = new ImageView(mContext);

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

imageView.setImageResource(resIds[position]);

imageView.setScaleType(ImageView.ScaleType.FIT_XY);

imageView.setLayoutParams(new Gallery.LayoutParams(163, 106));

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

imageView.setBackgroundResource(mGalleryItemBackground);

return imageView;

}

  四、相关章节

    android中文api(79)——Gallery
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: