且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2022-07-05 06:03:07

正文

  一、结构

 

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

 


本文转自over140 51CTO博客,原文链接:http://blog.51cto.com/over140/582439,如需转载请自行联系原作者