Could you instead do something like
imageView.setOnTouchListener(new View.OnTouchListener()
{
@Override
public boolean onTouch(View v, MotionEvent event)
{
if (event.getAction() == MotionEvent.ACTION_DOWN)
{
// event.getX() and event.getY() give you the co-ordinate
// of the touch, and from that you can work out which thing
// has been touched and so what to do?
}
}
});
?
A stupid relativelayout example, positions three imageviews containing an icon over a TextView with lots of text in it:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/textView1" android:text="TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView TextView " android:layout_alignParentTop="true" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView>
<ImageView android:id="@+id/imageView1" android:src="@drawable/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true"></ImageView>
<ImageView android:id="@+id/imageView2" android:src="@drawable/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="10dp"></ImageView>
<ImageView android:id="@+id/imageView3" android:src="@drawable/icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_marginLeft="25dp" android:layout_marginTop="35dp"></ImageView>
</RelativeLayout>
Note that z-order is defined by order in the xml so the further down in the file something is, the higher it is in the display.