我做的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>
我的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>
解决方案 »
- android nfc 打开文件
- 我把联系人全部查询出来了 想要放到一个listview里面去怎么放呢?
- 华为C8650 Root,手机上已显示Root,但Adb Shelll依然是$,为什么?
- 我下载XML,取出里面的中文字,打印就出现乱码
- 求android HOOK例子,越简单越好
- 集成第三方Apk,老是找不到对应的so库文件,但明明so库文件已经放/system/lib目录下了
- 一个Activity调用了两次OnCreate?
- 环境问题,Ubuntu上模拟器不能关闭,而且不能上网
- 求助了,希望大家能帮帮我,谢谢了
- 源代码下载
- 【急】关于File 中文文件名
- 我这个处理图片移动是不是有问题
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是代表毫秒,也就是说这里我让每两次笔画的时间间隔延长了一小时