自定义网格视图与行间距和列宽 [英] Custom Grid View with Row span and Column span

查看:210
本文介绍了自定义网格视图与行间距和列宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现一个网格视图,它具有图形视图如下。我已经通过各种博客和做题了,可惜我不能够提供行和列跨度为一个特定的网格项和网格视图也并不支持该功能。 而且我不希望创建动态滚动视图与其他视图之间的有大量的数据,这会导致性能问题。 因此,如果任何人有任何建议。请回复 。 提前致谢。

i am trying to implement a grid view which has the Graphical view as follows. I have gone through various blogs and S.O questions, and unfortunately i am not able to provide a row and column span to one particular grid item and grid view also does not support this feature. And i don't want to create Dynamic Scroll View with other views in between as the there is a lot of data and it causes performance issues. So if any one have any suggestions. Please reply . Thanks in advance.

推荐答案

你打算重复图案的滚动视图?为了更清楚,你的网格项目有大跨度的重复定期?

Do you intend to repeat the pattern for your scrollable view? To be more clear, does your Grid item with large span repeat at regular intervals?

一种选择是使用列表视图和两个普通的意见,列表视图与标记的一行诸如special_row实现你的大跨度来看,实施定期的意见,另一行包含普通行标签。基于该要求可以通过访问行标签回收的行。

One option would be to use a list view and implement your large span view with two normal views as one row of the list view with a tag such as "special_row" and implement regular views as another row with tag like "normal row". Based on the requirement you can recycle the rows by accessing the row tags.

编辑:

我发现,实现了Pinterest的用户界面一样为Android库。这在其对称的观点。结帐 PinterestLisView

I found a library that implements pinterest like UI for android. This has a symmetric views in it. Checkout PinterestLisView.

编辑:

这里是另一种有趣的技术,通过指定coulmn跨度和行跨度网格项目。我从了这个问题。我想你可以通过编程方式指定列和行跨度破除电网项目的静态XML声明。

Here is another interesting technique by specifying coulmn span and row spans for the grid items. I took from this question. I guess you can do away with the static xml declaration of grid items by programmatically specifying column and row spans.

这篇关于自定义网格视图与行间距和列宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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