<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代碼:什麼是所有根佈局Android中的父佈局
linearLayout=(LinearLayout) findViewById(R.id.linearLayout);
System.out.println(linearLayout.getParent());
它會告訴你的FrameLayout是線性的父佈局layout.please告訴 1.框架佈局是怎麼線性佈局的父級佈局? 2.默認窗口有幀佈局?
請提前幫助我。
廣告1 FrameLayout可以是包括LinearLayout在內的任何視圖的父級,請檢查它:Window.getDecorView() – pskink 2014-08-29 05:41:47