国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

自定義控件基礎 requestLayout()和invalidate()區別

2019-11-08 00:29:36
字體:
來源:轉載
供稿:網友

requestLayout(): 重新布局整個ViewTree,開始調用measure()方法。 requestLayout()是view的方法,view也可以調用該方法。

Call this when something has changed which has invalidated the layout of this view. This will schedule a layout pass of the view tree. This should not be called while the view hierarchy is currently in a layout pass.

invalidate(): 如果當前View可見,onDraw()方法將會被調用。

Invalidate the whole view. If the view is visible, onDraw() will be called at some point in the future.This must be called from a UI thread. To call from a non-UI thread, call postInvalidate().

在寫SimpleIndicator時,并不是一定不會走onMeasure()方法,在某種條件下會走該方法的。可以搜其他的源碼分析文章,具體查看。源碼分析


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 辽阳县| 永城市| 黄梅县| 五华县| 驻马店市| 九寨沟县| 思南县| 建阳市| 五华县| 建宁县| 永泰县| 滁州市| 新密市| 沙洋县| 上思县| 长宁县| 南岸区| 武穴市| 梅河口市| 金秀| 防城港市| 明溪县| 海原县| 桐城市| 眉山市| 伊吾县| 祁连县| 德兴市| 儋州市| 湖口县| 资溪县| 铅山县| 廊坊市| 深泽县| 阿克苏市| 乐业县| 洛南县| 昌图县| 浦东新区| 株洲县| 新宁县|