最近看到有人在问这三个参数的含义,其实帮助已经很详细的介绍了这三个参数,看来还是要好好学学英语了,不然连解释都看不懂。

/**
     * Get a View that displays the data at the specified position in the data set. You can either
     * create a View manually or inflate it from an XML layout file. When the View is inflated, the
     * parent View (GridView, ListView...) will apply default layout parameters unless you use
     * {@link android.view.LayoutInflater#inflate(int, android.view.ViewGroup, boolean)}
     * to specify a root view and to prevent attachment to the root.
     * 
     * @param position The position of the item within the adapter's data set of the item whose view
     *        we want.
     * @param convertView The old view to reuse, if possible. Note: You should check that this view
     *        is non-null and of an appropriate type before using. If it is not possible to convert
     *        this view to display the correct data, this method can create a new view.
     * @param parent The parent that this view will eventually be attached to
     * @return A View corresponding to the data at the specified position.
     */

public View getView(int position, View convertView, final ViewGroup parent)三个参数的意思的更多相关文章

  1. 在getview方法中有三个参数,起到优化的部分为ViewHolder的使用,主要方法setTag(),getTag()

    适配器代码如下: public class Myadapter extends BaseAdapter { List<String> date; Context context; //构造 ...

  2. 【Android - 自定义View】之自定义View浅析

    1.概述 Android自定义View / ViewGroup的步骤大致如下: 1) 自定义属性: 2) 选择和设置构造方法: 3) 重写onMeasure()方法: 4) 重写onDraw()方法: ...

  3. public void onItemClick(AdapterView arg0, View view, int position,long arg3)详解【整理自网络】

    参考自: http://blog.csdn.net/zwq1457/article/details/8282717 http://blog.iamzsx.me/show.html?id=147001 ...

  4. ListView onItemClick(AdapterView<?> parent, View view, int position, long id)参数详解

    public void onItemClick(AdapterView<?> parent, View view, int position, long id) { parent.getA ...

  5. onItemClick(AdapterView<?> parent, View view, int position, long id)

    Public Methods public abstract void onItemClick (AdapterView<?> parent, View view, int positio ...

  6. Android View.setId(int id) 用法

    Android View.setId(int id) 用法 当要在代码中动态的添加View并且为其设置id时,如果直接用一个int值时,Studio会警告. 经过查询,动态设置id的方法有两种; 1. ...

  7. AdapterView&lt;?&gt; arg0, View arg1, int arg2, long arg3參数含义

    arg0:是指父Vjew arg1就是你点击的那个Item的View arg2是position,position是你适配器里面的position arg3是id,通常是第几个项.id是哪个项View ...

  8. Android中自定义样式与View的构造函数中的第三个参数defStyle的意义

    零.序 一.自定义Style 二.在XML中为属性声明属性值 1. 在layout中定义属性 2. 设置Style 3. 通过Theme指定 三.在运行时获取属性值 1. View的第三个构造函数的第 ...

  9. 获取View的截图-将View转换为Bitmap对象

    开发中,有时候需要获取View的截图来做动画来达到动画流程的目的 原理:将View的内容画到一个Bitmap画布上,然后取出 下面封装了一个从View生成Bitmap的工具类 /** * 将View转 ...

随机推荐

  1. 飞行器的Pitch Yaw Roll概念图解

    前进方向为Z轴 Pitch 升降 绕X轴  对应常见Φ(phi)角: Yaw 偏航 绕Y轴 对应常见θ(theta)角: Roll 翻滚 绕Z轴 对应常见φ(psi)角: 对应表: 参考网址NASA: ...

  2. Java 8 VM GC Tunning Guild Charter 9-b

    第九章 G1 GC The Garbage-First (G1) garbage collector is a server-style garbage collector, targeted for ...

  3. android 解决启动页面加载图片空白以及去掉标题栏

    有时候启动页面根据白天晚上来启动时实现加载不同的图片效果,但是加载时会出现短暂的空白,解决方法如下: android:theme="@android:style/Theme.Transluc ...

  4. Fixing:insert_modules not found

    搞linux的最怕的就是panic.满屏的报错不知头绪,百度出来的还都是抄来抄去的垃圾. 我遇到的错误已经解决,所以不想再看到报错了..google出来两个没有上下文的文本,因为和他们差不多,在下面贴 ...

  5. release下去除nslog宏

    #ifdef __OPTIMIZE__ #define NSLog(...) #endif 加在pch文件里面

  6. Linux查看系统基本信息

    问题描述:         查看系统基本信息 问题解决:     (1)lspci 是一个用来显示系统中所有PCI总线设备或连接到该总线上的所有设备的工具. 用法:    lspci -v (1.1) ...

  7. POJ 1680 Fork() Makes Trouble

    原题链接:http://poj.org/problem?id=1680 对这道题,我只能说:我不知道题目是什么意思,但是AC还是没有问题的. 看来题目半天没明白fork()怎么个工作,但是看样例(根据 ...

  8. 【BZOJ】【1770】【Usaco2009 Nov】lights 灯

    高斯消元解XOR方程组 一眼看上去是高斯消元解xor方程组……但是不会写……sad 去膜拜了Hzwer和ZYF Hzwer啥也没说,还是zyf靠谱…… 当多解的时候就需要爆搜枚举自由元的情况,找最优解 ...

  9. 从String类看写C++ class需要注意的地方

    #include <iostream> #include <string.h> using namespace std; class String { char* m_data ...

  10. 使用JAVA反射初始化数组(转)

    在做JSON解析时,遇到了在不知道数组类型的前期下,需要转化为具体类型数组的问题.可以使用JAVA的反射来做. JSONArray jsonArray = (JSONArray) entry.getV ...