Activity獲取setContentView()後得到的View

1、獲取setContentView()後得到的View:

View contentView = ((ViewGroup) (getWindow().getDecorView().findViewById(android.R.id.content))).getChildAt(0);

2、獲取DecView:

View rootView = getWindow().getDecorView();
發佈了72 篇原創文章 · 獲贊 71 · 訪問量 16萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章