美文网首页
android UI绘制流程 源码

android UI绘制流程 源码

作者: GoodWen | 来源:发表于2019-08-19 15:33 被阅读0次

1,view是如何被添加到屏幕窗口上:

----》创建顶层布局容器 DecorView

----》在顶层布局中加载加载记错布局ViewGroup

----》将ContentView添加到基础布局中的FrameLayout中

          setContentView()           getWindow().setContentView()      了解getWindow()   是返回一个window抽象类,仅仅存在唯一实现类 phoneWindow

于是乎  查看phoneWindow类源码    在类中搜索  setcontentView() 方法  如下图

走到这里decorView已经创建完成  我们回到 phoneWindow  installDecor()方法

相关文章

网友评论

      本文标题:android UI绘制流程 源码

      本文链接:https://www.haomeiwen.com/subject/okgssctx.html