首页 > 移动平台 > 详细

android draw() onDraw() dispathDraw() onDrawScrollBars

时间:2014-05-14 07:54:22      阅读:501      评论:0      收藏:0      [点我收藏+]

 

/*
* Draw traversal performs several drawing steps which must be executed
* in the appropriate order:
*
* 1. Draw the background
* 2. If necessary, save the canvas‘ layers to prepare for fading
* 3. Draw view‘s content
* 4. Draw children
* 5. If necessary, draw the fading edges and restore layers
* 6. Draw decorations (scrollbars for instance)
*/

// Step 1, draw the background, if needed

// Step 3, draw the content
if (!dirtyOpaque) onDraw(canvas);

// Step 4, draw the children
dispatchDraw(canvas);

// Step 6, draw decorations (scrollbars)
onDrawScrollBars(canvas);

 

onDraw():When custom a view, overriding this method

 

measure(内部调用onMeasure)

layout(内部调用onLayout)

draw(内部调用ondraw)

处理组件的布局通常要重写onMesure和onLayout这两个方法

Reference:

http://blog.csdn.net/czh0766/article/details/5790295

http://blog.csdn.net/scorplopan/article/details/6302827

android draw() onDraw() dispathDraw() onDrawScrollBars,布布扣,bubuko.com

android draw() onDraw() dispathDraw() onDrawScrollBars

原文:http://www.cnblogs.com/ZacharyHodgeZou/p/3725672.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!