Я сталкиваюсь с проблемами макета гнезда и выбрасываю некоторые исключения. Ошибка: «Этот макет 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>
Спасибо всем.
Error Log? - person Jin35   schedule 18.07.2012