I have a custom-made view that extends the View class. I would like 2 instances of my custom view layered directly on top of each other. How should my layout file look to ac
While it's true that you can achieve layering using RelativeLayout and FrameLayout, in API 21 and higher.. things have changed.
In API 21 and higher, the later children of xml doesn't mean it will overlap earlier children. Instead, it uses Elevation to determine which view will overlap other view (Z-Index).
For example, if you have something like this.
The View will not be visible even though it was added after Button. That's because Button has higher elevation than View. To rearrange Z-Index you can add elevation attribute to respective views.
This way the View will overlap the Button.
More Information on Elevation & Shadows: https://material.io/guidelines/material-design/elevation-shadows.html