我有一个RelativeLayout,看起来像这样:
<?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"
android:background="#65ffffff" >
<com.sonyericsson.zoom.ImageZoomView
android:id="@+id/zoomview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</RelativeLayout>
我有一组针对RelativeLayout的触摸事件。然而,com.sonyericsson.zoom.ImageZoomView也有自己处理触摸事件的逻辑。
当我在屏幕上执行任何触摸事件时,首先调用的是com.sonyericsson.zoom.ImageZoomView类的触摸监听器(这是我期望的)。问题是,如果我在该触摸事件中返回“true”,则RelativeLayout的触摸监听器将不会被调用。而如果我返回“false”,它们将被调用,但是,类ImageZoomView所做的触摸处理就会被简单地忽略!(我猜测因为最终我返回了“false”,所以Android会忽略类com.sonyericsson.zoom.ImageZoomView之前所做的任何UI更新的触摸事件)。
简而言之,我想要能够在我的com.sonyericsson.zoom.ImageZoomView和RelativeLayout中同时处理同一个触摸事件。
有没有什么办法可以做到这一点?
我正在使用Android 2.2+。
谢谢!