建立在Android的自己的适配器? [英] Create Own Adapter in Android?

查看:117
本文介绍了建立在Android的自己的适配器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Android中创建自己的适配器?

How to Create Own Adapter in Android?

推荐答案

创建扩展抽象类的 BaseAdapter 然后实现以下方法:

Create a new class that extends the abstract class BaseAdapter and then implement the following methods:

  • getCount将
  • 的getItem
  • getItemId
  • getView

您也可以搜索的适配器教程。我建议:

You can also search for adapter tutorials. I'd recommend:

  1. 绑定数据用适配器
  2. 如上所述
  3. 在入门上实施
  4. 在提问的时候,你有问题,你的执行
  1. Reading the Binding to Data with AdapterView
  2. Getting started on an implementation as described above
  3. Asking questions when you have problems with your implementation

的实施将取决于基础数据,你正试图重新present,所以一个单行的问题真的不会削减它。

The implementation will depend on the underlying data you are trying to represent, so a one-line question is really not going to cut it.

这篇关于建立在Android的自己的适配器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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