android view中有layout(int l, int t, int r, int b) 和offsetTopAndBottom(int offset)和offsetLeftAndRight(int offset) 3个方法,可以用来操作view的位置,下面我们来移动一个view
<?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"
android:id="@+id/ll" >
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="button"/>
<com.test.gesture.TestView
android:id="@+id/tv"
android:layout_gravity="center"
android:layout_width="70dp"
an