I have seen numerous applications that use layering in their layouts. When I speak of layering I am referring to layers in the z-axis relative to the view of the user. One such app is the Craigslist Notification app where on top of the listView there is a plus sign near the bottom to allow user access to adding an additional list item.
In my case, I am successfully using a GestureListener to turn pages. Works well, but I would like to superimpose a transparent right and left arrow png on the edges of the pages if there are pages back or forward of the one the user is currently on.
I have searched, but not quite sure how to have 2 elements of a Layout consume the same space simultaneously. In this case you have the content of the page (layout), and the need for something on top of (z-axis) of that layout.
Can someone point me in the right direction?
z-axis (plural z-axes) (algebraic geometry) The axis on a graph of at least three dimensions that is usually drawn vertically and usually shows the range of values of a variable dependent on two other variables or the third independent variable.
The x axis is in the plane of the screen and is positive toward the right and negative toward the left. The y axis is in the plane of the screen and is positive toward the top and negative toward the bottom. The z axis is perpendicular to the screen or keyboard, and is positive extending outward from the screen.
Try using FrameLayout.
FrameLayout always places things one on top of the other and always in reference to the upper lefthand corner, so you'll need to use separate layouts inside of FrameLayout to place your objects where you want the on the screen.
Remember that android will put things into your layout in the order that they are list, so place objects at the bottom of the layout that you want near the top of your display.
Here's a quick example (don't forget to add proper xml header data to the top node):
<FrameLayout> <RelativeLayout> <!-- Place the objects you want on the bottom here --> </RelativeLayout> <RelativeLayout> <!-- Place the objects you want on the top here --> </RelativeLayout> </FrameLayout>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With