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

/**
     * 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. 【转】Eazfuscator.NET 3.3中混淆化需要注意的一些问题

    对于DLL,Eazfuscator.NET默认不会混淆化任何公共成员,因为类库的公共成员很有可能被外界调用,而对于EXE的程序集,所有类型都可能被混淆化.注意上面这句话有一个“可能”,因为Eazfus ...

  2. COUNT(*),count(1),COUNT(ALL expression),COUNT(DISTINCT expression)

    创建一个测试表 IF OBJECT_ID( 'dbo.T1' , 'U' )IS NOT NULL BEGIN DROP TABLE dbo.T1; END; GO )); GO INSERT INT ...

  3. IE中出现 "Stack overflow at line" 错误的解决方法

    在做网站时遇到一个问题,网站用的以前的程序,在没有改过什么程序的情况下,页面总是提示Stack overflow at line 0的错误,而以前的网站都正常没有出现过这种情况,在网上找了一下解决办法 ...

  4. AVG()和to_date()函数的使用

    1.一道关于AVG函数和NULL值的面试题 某部门有10个员工,其中9个工资为1000,另一个为NULL,当使用AVG函数取该部门平均工资时,结果应该是多少? A.1000 B.900 我这里把题目再 ...

  5. 多态&&父类调用子类特有的方法

    /* 多态 1.没有继承就没有多态 2.代码的体现:父类类型的指针指向子类对象 3.好处:如果函数\方法参数使用的是父类对象,可以传入父类.子类对象 4.局限性: 1>父类类型的变量,不能直接调 ...

  6. Windows 7 下配置IIS,并且局域网内可访问

    win7的iis很麻烦滴!我搭建过一次!不过有点问题!还是xp好! 一.进入Win7的 控制面板,选择左侧的 打开或关闭Windows功能 . 二.现在出现了安装Windows功能的选项菜单,注意选择 ...

  7. Android Studio:Gradle常用命令

    Android Studio中自带Terminal,可以直接使用gradle命令,不必另开命令窗口,相当方便,下面总结一下常用的命令: 1.查看Gradle版本号      ./gradlew -v  ...

  8. EXT经验--查询EditorGridPanel的tbar的默认配置对象

    前言:EXT的API可谓熟悉EXT的葵花宝典,会看API可谓对于配置EXT,学习EXT最重要的基本功,这点相对于学习轻量级的Easyui来说更加明显. 比如下面的一段代码:注:在Ext.grid.Ed ...

  9. struts2 ,web.xml中配置为/*.action,运行报错Invalid <url-pattern> /*.action in filter mapp

    首先,修改成: <filter-mapping>  <filter-name>struts2</filter-name>  <url-pattern>/ ...

  10. NYOJ-44 子串和 AC 分类: NYOJ 2014-01-04 22:53 154人阅读 评论(0) 收藏

    作为菜鸟一枚,对子串和的代码完全就是硬算 的..结果是TLE #include<stdio.h> int jh(int x,int y,int num[],int sum[]); int ...