Android的gridview的行分隔/分离器

编程入门 行业动态 更新时间:2024-10-26 18:29:55
本文介绍了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:

stackoverflow/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的行分隔/分离器

本文发布于:2023-11-25 07:28:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1628861.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分离器   Android   gridview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!