Reputation: 12018
I have list of images added in a LinearLayout
+------------+
| Image 1 |
+------------+
| Image 2 |
+------------+
| Image 3 |
+------------+
I want every 2nd image to get Displayed above 1st and 3rd Image.
For that I have set Bottom Margin of Image 1
to -10
pixels so Image 2
overrides Image 1
and it works, but this same logic does not work for Image 3
, Image 2
does not override Image 3
s Top portion, as i have given -10
top margin for the Image 3
.
I have also tried bring_to_front
for Image 2
but it does not work.
How Should i get it working.
Thanks,
PP.
Upvotes: 1
Views: 7925
Reputation: 36484
FrameLayout will be an ideal choice for such a case. It allows z-ordering of child views and will stack all the view over one another. Using view#setVisibility(...)
you can toggle visibility of your views to get the desired effect.
Upvotes: 1
Reputation: 3713
use framelayout(it is like div tag in html)
links: http://developer.android.com/resources/articles/layout-tricks-merge.html http://android-pro.blogspot.com/2010/02/frame-layout.html
Upvotes: 1