Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/213.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android中所有根布局的父布局是什么_Android_Android Linearlayout_Parent Child_Android Framelayout_Gravity - Fatal编程技术网

Android中所有根布局的父布局是什么

Android中所有根布局的父布局是什么,android,android-linearlayout,parent-child,android-framelayout,gravity,Android,Android Linearlayout,Parent Child,Android Framelayout,Gravity,它将显示framelayout是线性布局的父布局。请告诉 1.框架布局如何作为线性布局的父布局? 2.默认情况下,窗口具有框架布局 请帮助我。提前谢谢。你说得对,DecorView将使用FrameLayout存储应用程序设置的所有内容。你可以阅读ad 1 FrameLayout的源代码,它可以是任何视图的父视图,包括LinearLayout,ad 2 check it:Window.getDecorView()谢谢SuiteAnshi。你能给我发一个链接/源代码让我了解decorview的更多知

它将显示framelayout是线性布局的父布局。请告诉 1.框架布局如何作为线性布局的父布局? 2.默认情况下,窗口具有框架布局


请帮助我。提前谢谢。

你说得对,
DecorView
将使用
FrameLayout
存储应用程序设置的所有内容。你可以阅读ad 1 FrameLayout的源代码,它可以是任何视图的父视图,包括LinearLayout,ad 2 check it:Window.getDecorView()谢谢SuiteAnshi。你能给我发一个链接/源代码让我了解decorview的更多知识吗。但我一直认为源代码是最好的教程。
<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> 
linearLayout=(LinearLayout) findViewById(R.id.linearLayout);
System.out.println(linearLayout.getParent());