我有一个相对布局,其中有两个元素。其中一个被隐藏了。类似这样(为例子简化)
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/fullscreenimage"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<AbsoluteLayout
android:id="@+id/layout_overlay"
android:layout_width="200dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:visibility="gone" >
<ImageView
android:id="@+id/imageView_option1"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_x="0dp"
android:layout_y="0dp"
android:src="@drawable/image1"
android:tag="1" />
<ImageView
android:id="@+id/imageView_option2"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_x="100dp"
android:layout_y="0dp"
android:src="@drawable/image2"
android:tag="2" />
</AbsoluteLayout>
</RelativeLayout>
在检测到全屏图像长按(并没有松开手指)后,我想显示这些选项并突出显示用户手指下面的选项。我更改了覆盖布局的可见性,但是选项图像的touchListener从未被调用。尝试从全屏图像的touchlistener中返回false,它始终被调用,但是选项图像上的listener从未被调用。