Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Android 中,是有一个根视图还是多个根视图?任何帮助,将不胜感激。
AnActivity有一个根视图。您可以通过getWindow().getDecorView().getRootView().
Activity
getWindow().getDecorView().getRootView()
所有活动只有一个根视图。你可以通过方法达到它findViewById(android.R.id.content);。
findViewById(android.R.id.content);