arrayAdapter中的getItem()如何工作? [英] How does getItem() in an arrayAdapter work?

查看:61
本文介绍了arrayAdapter中的getItem()如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从手册和Internet上阅读了很多解释getView方法的教程,但是我不明白他们为什么使用它.谁能用一些例子或片段向我解释一下?

I've read lots of tutorials from my manual and on the internet that explain the getView method, but I haven't understood why they use it. Could anyone explain it to me with some examples or snippets?

推荐答案

getItem()返回项目的数据对象.它为您提供了一种访问适配器中数据的方法.例如,您的数组适配器包含字符串元素, getItem()返回一个字符串对象.

getItem() returns the item's data object. It provides a way for you to access data in the adapter. For example, your array adapter holds string elements, getItem() returns a string object.

这篇关于arrayAdapter中的getItem()如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆