本文介绍了是否有可能延长AbsListView做出新的ListView实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找创造一个文体不同的列表视图,像许多其他的人,我开始寻找延长AbsListView。每Android的文档,AbsListView是:

I've been looking at creating a stylistically different list view, like many other people, and I started by looking to extend AbsListView. Per the Android doc, AbsListView is:

这可被用来实现物品的虚拟列出的基类。名单没有一个空间的定义在这里。例如,这类的subclases可以在网格中显示的列表的内容,在一个转盘,作为栈等

在ListView控件执行一些努力和审查,它看起来像它可能无法延长AbsListView的ListView做,因为这两类连接器和无法访问某些封装件的方式。我偶然在这种形式罗曼盖伊:

After some effort and review of the ListView implementation, it looks like it may not be possible to extend AbsListView the way ListView does because of the coupling of the two classes and the inability to access certain package members. I stumbled on this form Romain Guy:

AbsListView和AbsSpinner被设计内的被扩展  框架。它们也可以扩大在第三方应用程序,但我们做了  不公开所有的目的,必要的保护字段和方法。  我们要非常小心,我们如何揭露此类API,从而不能获得  工具和未来的扩展和内部的变化。我们目前的  建议是,你只需复制/粘贴,你需要里面的code您  应用程序。

我开始尝试这样做,但复制AbsListView成为复制的兔子洞在很多其他的东西,它实际上只是看起来像一个亏本生意。我想看看是否有人已成功延伸AbsListView谁可以共享的方法。

I started trying to do this but copying AbsListView becomes a rabbit hole of copying in a bunch of other stuff and it really just seems like a losing proposition. I wanted to see if anyone has had success extending AbsListView who could share a methodology.

[1] http://developer.android.com/reference/android/widget/AbsListView.html

[2] <一个href="https://groups.google.com/forum/?fromgroups#!topic/android-developers/UhbR1tpVvF0">https://groups.google.com/forum/?fromgroups#!topic/android-developers/UhbR1tpVvF0

推荐答案

还有索尼的一个很好的教程(虽然它们扩展适配器视图,而不是AbsListView)位置:

there is a nice tutorial of sony (though they extend AdapterView and not AbsListView) here:

  1. http://developer.sonymobile.com/2010/05/20/android-tutorial-making-your-own-3d-list-part-1/

http://developer.sonymobile.com/2010/05/31/android-tutorial-making-your-own-3d-list-part-2/

http://developer.sonymobile.com/2010/06/23/android-tutorial-making-your-own-3d-list-part-3/

这篇关于是否有可能延长AbsListView做出新的ListView实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 00:48
查看更多