From 74d50cd2ed1c24e68d79197684b78877a743b4d8 Mon Sep 17 00:00:00 2001 From: sloop Date: Wed, 13 Jan 2016 09:32:48 +0800 Subject: [PATCH] =?UTF-8?q?Update=20=E8=87=AA=E5=AE=9A=E4=B9=89View?= =?UTF-8?q?=E5=87=A0=E4=B8=AA=E9=87=8D=E8=A6=81=E7=9A=84=E5=87=BD=E6=95=B0?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 问题/View/自定义View几个重要的函数.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/问题/View/自定义View几个重要的函数.md b/问题/View/自定义View几个重要的函数.md index 1e319cb..7a2a489 100644 --- a/问题/View/自定义View几个重要的函数.md +++ b/问题/View/自定义View几个重要的函数.md @@ -24,3 +24,14 @@ 一般来说,自定义View在大多数情况下都有替代方案,利用图片或者组合动画来实现,但是使用后者可能会造成内存耗费过大,制作麻烦更诸多问题。 +## 二.几个重要的函数 + +### 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) {} +``` +