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

/**
     * 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. -sh: ./helloworld: not found

    最近在玩FriendlyARM mini2440的板子,编译了一个helloworld,通过ftp上传到开发版的文件系统中,chmod 777 helloworld,运行./helloworld,出现 ...

  2. WPF自定义控件(三)——Window

    一样!先来看看效果吧: 怎么样?效果很好吧,而且不只是样式哟!所有系统窗体有的交互操作都可以实现! 但可惜...有很多和系统API有关的东西本人了解得并不多,所以这个窗体是基于他人的成果上产生的.关于 ...

  3. PAT IO-02 整数四则运算

    /* *PAT IO-02 整数四则运算 *2015-07-30 *作者:flx413 */ #include<stdio.h> int main() { int a, b; scanf( ...

  4. CentOS安装thrift

    下载thrift依赖的东西  yum -y install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-dev ...

  5. [CSS]学习总结

    1. 遮挡层 .occlusion { opacity: -.35;/*透明程度*/ -moz-opacity: -.35; filter: alpha(opacity=-35); height: 1 ...

  6. 一段Android里面打印CallStatck的代码

    public void dumpCallStack() { java.util.Map<Thread, StackTraceElement[]> ts = Thread.getAllSta ...

  7. PHP获取mysql数据表的字段名称和详细信息的方法

    首先我们需要了解下查询MySQL数据库/表相关信息的SQL语句: 代码如下: SHOW DATABASES                                //列出 MySQL Serv ...

  8. ibatis.net demo

    1. download ibatis.nethttps://code.google.com/p/mybatisnet/ 2. add all dll as reference to your proj ...

  9. OC的类的构造方法

    构造方法:用来初始化对象的:首先分解一下创建对象的过程: Person *p = [Person new]; // new方法是alloc 和 init 这两个方法的组合: 完整的创建可用对象的过程: ...

  10. c++ uuid生成法则

    http://www.jb51.net/LINUXjishu/39614.html CentOS #include <uuid/uuid.h> 找不到文件解决方法: sudo yum in ...