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

前言

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

声明

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

    博客园:http://www.cnblogs.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,以此提供可以容纳当前的转换信息和先前的位置转换信息的场所。

 

  三、补充

  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.     }
 

  四、相关章节

    android中文api(79)——Gallery

原文地址:https://www.cnblogs.com/over140/p/1918649.html