Android自定义View的三种方式:继承布局,继承原生控件,继承View。博客有详解:https://blog.csdn.net/AlpinistWang/article/details/86773137