有没有办法使UI元素稍微重叠(一个又一个)而不使用绝对布局? [英] Is there any way to have UI elements slightly overlap (one on top of one another) without using absolute layouts?
问题描述
可以说我在屏幕上有一个列表,我一直希望可以使用它。我还希望小图像或textview与listview稍微重叠。不用绝对的布局参数就能做到吗?
Lets say I have a list on screen, which I always want to be usable. I also want a small image or textview to slightly overlap the listview. Is anything this possible without using absolute layout parameters?
我从来没有在任何Android应用程序或教程中看到它,但是在许多iPhone应用程序中都有类似的东西。
I've never seen it in any android app or tutorial, but there are things like this in many iPhone apps. It adds a nice touch.
(此外,我没有任何代码可显示,因为我不确定从哪里开始)
(Also, I don't have any code to show because I'm not sure where to start)
推荐答案
相对布局也允许事物重叠。稍后在xml中声明的视图将位于顶部。我认为对齐视图边缘和使用边距应该可以使您轻松实现这一效果。
Relative Layouts also allow things to overlap. Views declared later in the xml will be on top. I believe that aligning view edges and use of margins should allow you to achieve this affect without great difficulty.
这篇关于有没有办法使UI元素稍微重叠(一个又一个)而不使用绝对布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!