Is there any way to have UI elements slightly overlap (one on top of one another) without using absolute layouts?

后端 未结 3 1660
渐次进展
渐次进展 2021-01-19 17:40

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

3条回答
  •  Happy的楠姐
    2021-01-19 18:21

    As well as RelativeLayouts, you can also use FrameLayouts to stack objects. Other than the z-order (last object declared = highest z-order), the child objects don't depend on the positioning of other objects in the group, so you can just set margins or gravity to position them.

    So in your instance, just declare a TextView after your ListView, and position it wherever you want. It won't interfere with the ListView's positioning, and it will sit on top.

提交回复
热议问题