0
스크롤 뷰 요소가 있고 내부에 안드로이드 응용 프로그램의 테이블 요소가 있습니다. 메뉴 요소도 삽입하고 싶습니다. 그러나 스크롤 뷰 안에 메뉴를 배치 할 때이 오류가 발생합니다. "스크롤 뷰에는 단 하나의 아이 ". 내 메뉴 및 방법은 어디에서 수정할 수 있습니까?메뉴를 만들 때 오류가 발생했습니다.
다음은 하나의 LinearLayout 내부에 자식의 모든 요소를 포장 할 수 내 XML 파일
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android1="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#eef1f5" >
<menu>
<item
android:id="@+id/new_game"
android:showAsAction="ifRoom"
android:title="new_game"/>
<item
android:id="@+id/help"
android:title="help"/>
</menu>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TableRow>
<Button
android:id="@+id/b3 "
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Connect" />
<Button
android1:id="@+id/b1 "
android1:layout_width="0dip"
android1:layout_height="wrap_content"
android1:layout_weight="1"
android1:text="Retrive Data" />
<Button
android:id="@+id/b2 "
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Close" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/systemId"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="SysId" >
</TextView>
<EditText
android:id="@+id/systemId1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/opMode"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Model" >
</TextView>
<EditText
android:id="@+id/opMode1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/DCTime"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="DCTimer" >
</TextView>
<EditText
android:id="@+id/DCTime1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/Ups"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="UPS" >
</TextView>
<EditText
android:id="@+id/Ups1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/Mode"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Mode " >
</TextView>
<EditText
android:id="@+id/Mode1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/LFBD"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="LFBD" >
</TextView>
<EditText
android:id="@+id/LFBD1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/Hybrid"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Hybrid" >
</TextView>
<EditText
android:id="@+id/Hybrid1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/PHC"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="PHC" >
</TextView>
<EditText
android:id="@+id/PHC1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/Now"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Now" >
</TextView>
<EditText
android:id="@+id/Now1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/GridCharging"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="GRID_CHRG" >
</TextView>
<EditText
android:id="@+id/GridCharging1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/SolarCharging"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="SOLR_CHRG" >
</TextView>
<EditText
android:id="@+id/SolarCharging1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/Trip"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Trip" >
</TextView>
<EditText
android:id="@+id/Trip1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/APSS"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="APSS" >
</TextView>
<EditText
android:id="@+id/APSS1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/TPSS"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TPSS" >
</TextView>
<EditText
android:id="@+id/TPSS1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/TPSSValue"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="AC_TIMER " >
</TextView>
<EditText
android:id="@+id/TPSSValue1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/BV"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Bat_Volt" >
</TextView>
<EditText
android:id="@+id/BV1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/SV"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Sol_Volt" >
</TextView>
<EditText
android:id="@+id/SV1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/TCT"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="TCT" >
</TextView>
<EditText
android:id="@+id/TCT1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
</TableRow>
<TableRow>
<TextView
android:id="@+id/Main"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Main_Volt" >
</TextView>
<EditText
android:id="@+id/Main1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/Load"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Load" >
</TextView>
<EditText
android:id="@+id/Load1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
<TextView
android:id="@+id/Amps"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Amps" >
</TextView>
<EditText
android:id="@+id/Amps1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1.1"
android:enabled="false" />
</TableRow>
</TableLayout>
</ScrollView>
ScrollView에는 직접 자식이 하나만있을 수 있습니다. 다른 레이아웃에서는 메뉴 및 TableLayout을 래핑해야합니다. –