<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/linearLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
/>
</LinearLayout>
我的 Java 代码:
linearLayout=(LinearLayout) findViewById(R.id.linearLayout);
System.out.println(linearLayout.getParent());
它会告诉你 framelayout 是线性布局的父布局。请告诉 1. frame布局怎么是线性布局的父布局? 2.默认窗口有框架布局?
请帮助我。提前致谢。
最佳答案
没错,DecorView
将使用一个FrameLayout
来存储应用程序设置的所有内容。您可以阅读 PhoneWindow
的来源
关于android - Android中All Root布局的父布局是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25562221/