This afternoon, the study of the Android custom control how to achieve, is a little bit of a look, now summed up, as a deeper memory, perhaps for those who have just started to learn Android will be a little help
Here are the steps I've summed up:
1. First, to create a attrs XML file to store the properties of the custom control, create an XML file, then use <declare-styeable> to declare the name of the control, and then use the <attr> The label implements the name of the property and the corresponding type.
2. Create the appropriate class, inherit the control class that you want to customize, and then implement the appropriate constructor method, define the variables associated with the property and the corresponding get and set methods, and define the function functions that belong to your own implementation.
3. Then direct reference in the activity through the package name is OK.
This is the general step of customizing the control, and when I have finished my project, the complete code is pasted out for everyone's reference.