我做的xml的一个layout文件里边有一个GestureOverlayView,在其中画一个手势,画完后,GestureOverlayView会自动清空。请问怎么不清空?请大家帮忙。
我的xml如下:<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical"> <LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_marginRight="6dip"
android:text="名称" android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText android:id="@+id/gesture_name"
android:layout_width="0dip" android:layout_weight="1.0"
android:layout_height="wrap_content" android:maxLength="40"
android:singleLine="true" /> </LinearLayout> <android.gesture.GestureOverlayView
android:id="@+id/mygestureview1" android:layout_height="wrap_content"
android:layout_width="fill_parent" android:fadeDuration="10000000"
android:fadeOffset="10000000" android:fadeEnabled="false"
android:layout_weight="1" android:gestureColor="#FF46A140">
</android.gesture.GestureOverlayView> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="horizontal" style="@android:style/ButtonBar"> <Button android:id="@+id/confirm" android:layout_width="0dip"
android:layout_weight="1" android:layout_height="wrap_content"
android:enabled="false" android:onClick="addGesture" android:text="@string/button_done" /> <Button android:id="@+id/cancel" android:layout_width="0dip"
android:layout_weight="1" android:layout_height="wrap_content"
android:onClick="cancelGesture" android:text="@string/button_discard" />
</LinearLayout>
</LinearLayout>

解决方案 »

  1.   

    <android.gesture.GestureOverlayView
        android:id="@+id/gesture" android:layout_width="200px"
        android:layout_height="200px" android:gestureColor="@color/blue"
        android:gestureStrokeType="multiple" android:gestureStrokeWidth="1"
        android:fadeOffset="3600000" />
    写成这种样子就不会消失了,使多笔画每两次的间隔时间延长,3600000是代表毫秒,也就是说这里我让每两次笔画的时间间隔延长了一小时