将GestureOverlayView放在ScrollView中,以便仍然可以记录手势 - Android

时间:2013-06-18 18:57:09

标签: java android scrollview gesture

我正在尝试在滚动视图中放置一个GestureOverlayView,以便我可以向下滚动并且GestureOverlayView将在那里。但是,GestureOverlayView不会录制我的手势。当我尝试在其上做手势时,整个窗口都会滚动。

当我触摸GestureOverlayView并且仍记录我的手势时,有没有办法禁用滚动?

这是我的xml粗略。我有一个包含webview和gestureoverlayview的scrollview。我希望能够滚动浏览webview并将gestureoverlayview放在webview的底部。然后我希望能够做出一个动作。现在,gestureoverlayview在webview下面就好了。但我无法做出手势,因为屏幕只是滚动而不是识别我的手势。

     <ScrollView
    android:id="@+id/scrollView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <WebView
            android:id="@+id/webView1"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_weight="2" />

        <RelativeLayout
            android:id="@+id/layout"
            android:layout_width="match_parent"
            android:layout_height="200dp" >

            <GestureOverlayView
                android:id="@+id/gesture"
                android:layout_width="650dp"
                android:layout_height="140dp"
                android:layout_alignParentTop="true"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="17dp"
                android:eventsInterceptionEnabled="true"
                android:fadeEnabled="false"
                android:fadeOffset="5"
                android:gestureColor="@color/black"
                android:gestureStrokeAngleThreshold="0.1"
                android:gestureStrokeLengthThreshold="0.1"
                android:gestureStrokeSquarenessThreshold="0.1"
                android:gestureStrokeType="multiple"
                android:gestureStrokeWidth="1.2"
                android:orientation="vertical"
                android:requiresFadingEdge="vertical" >
            </GestureOverlayView>
          </LinearLayout>
        </ScrollView>

0 个答案:

没有答案