Update 自定义View几个重要的函数.md

This commit is contained in:
sloop
2016-01-13 09:32:48 +08:00
parent baaa403334
commit 74d50cd2ed

View File

@@ -24,3 +24,14 @@
<b>一般来说自定义View在大多数情况下都有替代方案利用图片或者组合动画来实现但是使用后者可能会造成内存耗费过大制作麻烦更诸多问题。</b>
## 二.几个重要的函数
### 1.构造函数
View的构造函数有四种重载分别如下
```
public void SloopView(Context context) {}
public void SloopView(Context context, AttributeSet attrs) {}
public void SloopView(Context context, AttributeSet attrs, int defStyle) {}
public void SloopView(Context context, AttributeSet attrs, int defStyle, int defRes) {}
```