自定义一个View,必须派生实现基类View的三个构造函数
//Simple constructor to use when creating a view from code
View(Context context)
//Constructor that is called when inflating a view from XML
View(Context context, AttributeSet attrs)
//Perform inflation from XML and apply a class-specific base style
View(Context context, AttributeSet attrs, int defStyle)