从setContentView分析应用的视图结构

参考从源码角度剖析 setContentView() 背后的机制 https://juejin.im/post/58dcd12e61ff4b006b051908

1 AppCompatDelegateImplV9.java

    public void setContentView(int resId) {
        ensureSubDecor();
        ViewGroup contentParent = (ViewGroup) mSubDecor.findViewById(android.R.id.content);
        contentParent.removeAllViews();
        LayoutInflater.from(mContext).inflate(resId, contentParent);
        mOriginalWindowCallback.onContentChanged();
    }

猜你喜欢

转载自blog.csdn.net/wangkaiblog/article/details/79688936
今日推荐