Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android: how to make a child view overlap the parent?

I need to implement the layout as in the picture. Parent and Sibling are in a vertical LinearLayout. So I need to make a child view to overlap it's parent. Can I do that in android?

layout

like image 785
netimen Avatar asked Mar 21 '11 16:03

netimen


People also ask

What is a Relative view?

RelativeLayout is a view group that displays child views in relative positions. The position of each view can be specified as relative to sibling elements (such as to the left-of or below another view) or in positions relative to the parent RelativeLayout area (such as aligned to the bottom, left or center).

Which layout defines how child views are positioned Relative to each other?

Android RelativeLayout enables you to specify how child views are positioned relative to each other. The position of each view can be specified as relative to sibling elements or relative to the parent.

What is Z index in Android?

Z-Index for Annotation Stacking Order on Android The annotation z-index defines the stacking order of annotations on a page.

How to use Linear layout in ConstraintLayout?

You can create linear layouts now with ConstraintLayout by constraining the sides of each element with each other. The quick way of creating these layouts is to select all the views together and right click to center horizontally or vertically.


1 Answers

If:

  1. sibling is a sibling of parent
  2. parent is a ViewGroup
  3. and you really want child to be a child of parent

then maybe you could consider using android:clipChildren set to false on parent.

like image 113
bigstones Avatar answered Nov 05 '22 23:11

bigstones