Android的gridview的行分隔/分离器 [英] android gridview row dividers / separators

查看:165
本文介绍了Android的gridview的行分隔/分离器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法,以显示行之间的(水平)分隔在GridView?

Is there a way to show (horizontal) dividers between rows in a gridview?

我试图把一个小的除法器 - 图像中的每个网格项如下,但是这不是一个解决方案,因为它不会跨越了一行时,不完全填充的物品的整排

I tried putting a small divider-image below every grid item, but this is not a solution, because it won't span the whole row when a row is not completely filled with items.

有没有办法只是增加每一行之间的形象呢?我只能找到改变行之间的空间的方法。

Is there a way to just add an image between every row? I can only find methods for changing the space between rows.

推荐答案

我结束了创建一个自定义的gridview的,是这样的:

I ended up creating a custom gridview, something like this:

http://stackoverflow.com/a/9757501/1310343

使用背景图像这正是高达在我的GridView一个项目,并具有devider在底部。

using a background image that is exactly as high as one item in my gridview, and has a devider at the bottom.

工程就像一个魅力!

这篇关于Android的gridview的行分隔/分离器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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