Draw images on top of each other in android
I have some images that I want to put on top of each other on random order.
If it possible using one ImageView or do I need to create multiple image views based on number of 开发者_JAVA技巧images?
You don't completely specify what you want.... if you want the images to be placed in different positions (in the X and Y axis), meaning that while watching the photo on the top you can see part of the other images, then you have to create different ImageViews
, or drawing them on a canvas (I think this one is much better).
If the images are just one on top of the other (hiding the one on the bottom), you just have to use one ImageView
.
LayerDrawable may fit your requirement, you may refer to this post overlay two images in android to set an imageview
精彩评论