ListView的重叠到相邻的项目 [英] ListView Overlap onto Adjacent Item
问题描述
我用一个ListView,合并在一起以MergeAdapter,我试图将其设置为使用StickyListHeaders我多么希望。下面是合并的ListView的设置方式:
I'm using a listview, merged together with MergeAdapter and I'm trying to set it up for using StickyListHeaders how I want. Here's how the merged ListView is set up:
ImageView的为第一要素。
ImageView as the first element.
的RelativeLayout含有的ImageView和TextView的作为第二元件。
RelativeLayout containing an ImageView and TextView as the second element.
ListView的项目。
ListView items populated from an adapter.
在第二个列表项,所述的ImageView的高度必须比TextView的高度高。但我想列表项的高度匹配的TextView的高度,而不是ImageView的(一个固定的高度,而不是WRAP_CONTENT)。这样一来,从第二个列表项的ImageView将理想重叠到第一个列表项的ImageView的。
In the second list item, the height of the ImageView has to be taller than the height of the TextView. But I want the list item height to match the TextView height instead of the ImageView (a fixed height instead of wrap_content). That way, the ImageView from the second list item would ideally overlap onto the ImageView of the first list item.
我已经试过搞乱与周围的透明度,设置布局的高度,和其他几件事情,但我不能得到它的工作。这是太复杂的情况发生,还是我失去了一些东西?想法?
I've tried messing around with transparency, setting the layout height, and a couple other things but I can't get it to work. Is this just too complicated to happen, or am I missing something? Ideas?
感谢。
推荐答案
我想出了一个办法可能不是最简单的,但它的作品。我只是把ImageView的一半在每个列表中的项目和裁剪源图像,以适应。
I figured out a way that might not be the simplest but it works. I just put half of the ImageView in each of the list items and cropped the source image to fit.
这篇关于ListView的重叠到相邻的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!