0
<?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

發佈您的LogCat和**相關代碼** – 2012-08-01 15:29:43

+0

有點偏離主題,但我強烈建議你也嘗試清理你的佈局。在渲染過程中,您將使用大量線性佈局,這將非常昂貴。更簡單的佈局在系統上更容易,並且更易於調試。我建議你看看RelativeLayout,因爲它是非常強大的創建更復雜的佈局:http://developer.android.com/reference/android/widget/RelativeLayout.html – Stevy888 2012-08-01 15:47:23

回答

1

,你需要給不同的ID對您的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> 

希望有幫助。

+0

我想你錯過了重命名幾個ID。但是,無論如何爲解決方案+1。 – Stevy888 2012-08-01 15:58:08

+0

謝謝。但我沒有想到我錯過了任何ID,因爲日食會給我一個錯誤,我測試了我的手機,它工作正常。你能告訴我我錯過了哪一個? – 0gravity 2012-08-01 16:06:14

+0

我看到textView1添加了幾次。 – Stevy888 2012-08-01 16:08:51