<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_weight="1"
android:text="MARKETING SUPERVISOR"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="CHALLAN"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_weight="1"
android:text="Perm.IncmTax Num."
android:gravity="center"/>
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="number"
android:gravity="center" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView2"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Customer Code Number"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center"/>
<EditText
android:id="@+id/editText2"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="number"
android:gravity="center">
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView3"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Customer Name"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText3"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView4"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Customer Address"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText4"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView5"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Name of Cosignee"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText5"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView6"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Address of Cosignee"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText6"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView7"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Sales Order"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText7"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="fill_parent"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Customer Order Date"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="INVOICE DETAILS"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Invoice Number"
android:gravity="center"/>
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView2"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Date of issue of Invoice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView3"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Time of Issue of Invoice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText3"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView4"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Date of Dispatch of Goods"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView5"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="fill_parent"
android:text="Time of Dispatch of Goods"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText5"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView6"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Description of Goods"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText6"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView7"
android:layout_weight="1"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_height="fill_parent"
android:text="Quantity Total"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText7"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView8"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Unit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView8"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Total Amount"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>
我在执行xml代码时得到“强制关闭”。 错误日志给出的错误如下: 1)TextView无法强制转换为android.view.ViewGroup 2)无法更新中央索引 还有一些奇怪的东西
答案 0 :(得分:1)
你必须为你的texViews
提供不同的身份证明:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView1"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_weight="1"
android:text="MARKETING SUPERVISOR"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView2"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="CHALLAN"
android:gravity="center"/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_weight="1"
android:text="Perm.IncmTax Num."
android:gravity="center"/>
<EditText
android:id="@+id/editText1"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="number"
android:gravity="center" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView4"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Customer Code Number"
android:textAppearance="?android:attr/textAppearanceMedium"
android:gravity="center"/>
<EditText
android:id="@+id/editText2"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="number"
android:gravity="center">
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView5"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Customer Name"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText3"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView6"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Customer Address"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText4"
android:gravity="center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView7"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Name of Cosignee"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText5"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView8"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Address of Cosignee"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText6"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView9"
android:gravity="center"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Sales Order"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText7"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="fill_parent"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView10"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:text="Customer Order Date"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText8"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:id="@+id/textView11"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="INVOICE DETAILS"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/textView12"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Invoice Number"
android:gravity="center"/>
<EditText
android:id="@+id/editText13"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="wrap_content"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView14"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Date of issue of Invoice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText15"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView16"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Time of Issue of Invoice"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText17"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView18"
android:layout_weight="1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Date of Dispatch of Goods"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText19"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView20"
android:layout_width="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:layout_height="fill_parent"
android:text="Time of Dispatch of Goods"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText21"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPersonName" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView22"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:text="Description of Goods"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText23"
android:layout_width="fill_parent"
android:layout_weight="1"
android:layout_height="fill_parent"
android:gravity="center"
android:inputType="textPostalAddress" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView24"
android:layout_weight="1"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_height="fill_parent"
android:text="Quantity Total"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText25"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:inputType="number" >
<requestFocus />
</EditText>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView26"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Unit"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText27"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<TextView
android:id="@+id/textView28"
android:layout_width="fill_parent"
android:gravity="center"
android:layout_weight="1"
android:layout_height="fill_parent"
android:text="Total Amount"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/editText29"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:gravity="center"
android:inputType="date" />
</LinearLayout>
</LinearLayout>
</ScrollView>
希望有所帮助。