当前位置:首页 > 未命名 > 正文内容

View work progress Layout and Draw

u3blog8年前 (2016-03-05)未命名183

Layout

Layout as the name,is to affirm the position of View,it include the position of View and it children view.

source code flow

layout method,call setFrame method to confirm own position,then call children View's onLayout method to confirm their position. 1 onLayout method are different by different view,because different view have different child layout,for example, linearlayout have vertical and horizon two mode.

Draw

Draw will draw the view to screen

draw step

1.draw background  bacground.draw(canvas) 2.draw itself onDraw 3.draw children dispatchDraw 4.draw decorate   onDrawScrollBars

setWillNotDraw method

If call it to pass a true param, system will not draw this view,it's false in most time,we can use it when the customer ViewGroup don't need draw,can let system do some optimize.

扫描二维码推送至手机访问。

版权声明:本文由u3blog发布,如需转载请注明出处。

本文链接:https://u3blog.xyz/?id=251

分享给朋友:

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。