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
本章内容是 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
相关文章推荐
- android中文api(80)——Gallery.LayoutParams
- Android 中文 API 文档 (45) —— AbsoluteLayout.LayoutParams
- Android 中文 API 文档 (45) —— AbsoluteLayout.LayoutParams
- Android7.0中文文档(API)-- LinearLayout.LayoutParams
- Android中文API(116)——TableLayout
- android中文api(79)——Gallery
- Android7.0中文文档(API)-- AbsoluteLayout.LayoutParams
- Android7.0中文文档(API)-- RelativeLayout.LayoutParams
- android中文api(79)——Gallery
- Android7.0中文文档(API)-- FrameLayout.LayoutParams
- android中文api(79)——Gallery
- Android Api WindowManager.LayoutParams
- android中文api(79)——Gallery
- Android7.0中文文档(API)-- AbsListView.LayoutParams
- Android7.0中文文档(API)-- ActionMenuView.LayoutParams
- Android 3.0 r1中文API文档(103) —— InputMethodManager [输入法]
- Android2.2 API 中文文档系列
- android 中文 API- Scroller
- Android2.2 API 中文文档系列(4) —— Manifest
- Android中文API(141) —— GridLayout