ネストのレイアウトの問題に直面し、いくつかの例外をスローします。エラーは「このLinearLayoutレイアウトまたはそのLinearLayout親は役に立たない...」です。私はこの設定によってこの警告を無視できることを知っています。
設定:ビルドパス->ビルドパスの構成.... Android Lintの設定でUselessParentを探し、無視する重大度を設定するか、[すべて無視]をクリックします。
ただし、Eclipseのグラフィカルレイアウトでは何も表示できず、エラーメッセージが表示されます-「インデックス:0、サイズ0、例外の詳細はウィンドウ>ビューの表示>エラーログに記録されます」。
グラフィックレイアウトにネストレイアウトを表示するにはどうすればよいですか?
これが私のコードです:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@drawable/menu_bg2"
android:orientation="vertical" >
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/menu_item1"
android:src="@drawable/alarm2x" />
<ImageButton
android:id="@+id/imageButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/menu_item2"
android:src="@drawable/bank2x" />
<ImageButton
android:id="@+id/imageButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/menu_item3"
android:src="@drawable/brief_case2x" />
<ImageButton
android:id="@+id/imageButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/menu_item4"
android:src="@drawable/trolley2x" />
<ImageButton
android:id="@+id/imageButton5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/menu_item5"
android:src="@drawable/calculator2x" />
</LinearLayout>
</LinearLayout>
皆さんありがとう。