我有以下XML文件被夸大,我不知道为什么我收到错误。这是XML文件:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/transitionForm"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/backgroundcolor"
android:orientation="horizontal" >
<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/assistekborders" />
<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/assistek_pro_borderwidgets" />
<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/assistek_pro_questionlabels" />
<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/assistek_pro_practicesessionwidgets" />
<include
android:layout_width="wrap_content"
android:layout_height="wrap_content"
layout="@layout/assistek_pro_progress" />
<ScrollView
android:id="@+id/svPRORGWidgets"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/ImageBottom"
android:layout_below="@+id/lblSubQuestionText"
android:layout_marginBottom="30px"
android:layout_marginRight="50px"
android:layout_marginTop="30px"
android:layout_toRightOf="@+id/lblQuestionNumber"
android:descendantFocusability="beforeDescendants" >
<!--
<TableLayout
android:id="@+id/tableLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dip" >
-->
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="fill_parent"
android:layout_column="1"
android:layout_height="wrap_content" >
</RadioGroup>
<RadioGroup
android:id="@+id/radioGroup2"
android:layout_width="fill_parent"
android:layout_column="2"
android:layout_height="wrap_content" >
</RadioGroup>
<!--
</TableRow>
</TableLayout>
-->
</ScrollView>
这是logcat错误。我不知道问题是什么 - 我的所有元素都有layout_width属性。
04-15 21:02:31.800: E/AndroidRuntime(3577): FATAL EXCEPTION: main
04-15 21:02:31.800: E/AndroidRuntime(3577): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.assistek.ediary/com.assistek.ediary.RadioGroupQuestionnaire}: java.lang.RuntimeException: Binary XML file line #46: You must supply a layout_width attribute.
04-15 21:02:31.800: E/AndroidRuntime(3577): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
04-15 21:02:31.800: E/AndroidRuntime(3577): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
04-15 21:02:31.800: E/AndroidRuntime(3577): at android.app.ActivityThread.access$600(ActivityThread.java:141)
答案 0 :(得分:0)
ScrollView只能有一个孩子。
尝试将您的RadioGroup放在LinearLayout或RelativeLayout中。