onLayout方法:
package com.example.administrator.myapplication;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
/**
* Created by Administrator on 2015/11/22 0022.
*/
public class MyView extends View {
int lastX ;
int lastY ;
public MyView(Context context) {
super