需要的ViewGroup(定制)的不同rowHeights中与Android的两列 [英] Need a ViewGroup(Customised) for Different Rowheights with two columns in Android

查看:175
本文介绍了需要的ViewGroup(定制)的不同rowHeights中与Android的两列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目的无限数量。想在两列显示它们与延迟加载的GridView。我用的GridView,其与相同​​的高度显示在一行中的所有项目尝试过。但希望它根据项高度作为附加的图像中进行调整。如果任何人有任何想法或任何ü已经有一些自定义的视图来实现这一点。请各地分享。
感谢名单提前。

I have infinite number of items. Want to display them in two columns as a GridView with lazy loading. I tried it with GridView, which is displaying all items in a row with the same height. But want it to be adjusted according to the item height as in the attached image. If anyone have any idea or any of u have implemented this with some customized View. Please share it across. Thanx in advance.

推荐答案

新的答案

看那 RecyclerView 。在 RecyclerView 替换的ListView ,并设计有足够的灵活性来支持您的使用情况。

Look at the RecyclerView. The RecyclerView replaces ListView and is designed to be flexible enough to support your use case.

RecyclerView 是支持库的一部分,在android系统L.添加,因此它应该在Android上的任何版本。的但要注意,在写这篇文章的时候,Android的L为preVIEW。

RecyclerView is a part of the support library, added in android L. So it should work on any version of Android. But beware, at the time of this writing, android L is in preview.

原来的答复

有一个名为Android的源$ C ​​$ C的实验班 StaggeredGridView ,你想要做什么。它包含在框架/ EX /部件/ 文件夹中。

There is an experimental class in the Android source code called StaggeredGridView that does what you want. It is contained in frameworks/ex/widgets/ folder.

这是尚未完成。然而,有些人已经建立的工作基础了它的原型。例如: http://www.androidviews.net/2013/01/pinterest-样适配器视图/

It isn't finished yet. However, some people have built working prototypes based off it. Ex: http://www.androidviews.net/2013/01/pinterest-like-adapterview/

这篇关于需要的ViewGroup(定制)的不同rowHeights中与Android的两列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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