Need to draw an ImageView on top of another ImageView without using FrameLayout

I have a LinearLayout [Horizontal Orientation] in which I have several ImageView objects nearby. I need to be able to move ImageView objects from side to side.

I can drag them, but I need to be able to draw them on top of each other while I drag.

So, if I have

(imageA) (imageB) side by side and I drag image A in the direction of image B, I need to draw image A on top of image B and vice versa.

So far, I have not been able to get drag and drop to work without problems [extending the ImageView, grabbing onTouchEvent, overwriting the onDraw method and translating the canvas], however, as soon as the ImageView moves, it is cropped due to its borders. I am trying to set new borders for drawing an ImageView, but this does not work either.

How to make one ImageView on top of another ImageView [without using FrameLayout]?

Thank,

+3
source share

All Articles