2011-11-11 8 views
0

私はスクロールビューでレイアウトを使用しています。しかし、Logcatで私はこのエラーを受け取りました: "java.lang.IllegalStateException:ScrollViewはただ1つの直接の子をホストすることができます" ..なぜ?ここでビューが唯一の子、すなわちを持ってスクロール;のLinearLayoutは...事前にスクロール表示のAndroidエラー

<?xml version="1.0" encoding="utf-8"?> 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/ScrollView01" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:background="#F2F2F2" 
     android:orientation="vertical" > 

     <TextView 
      android:id="@+id/taskName" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal" 
      android:textColor="#000000" 
      android:textSize="30dip" > 
     </TextView> 

     <LinearLayout 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" > 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Status: " 
       android:textColor="#000000" 
       android:textSize="20dip" > 
      </TextView> 

      <TextView 
       android:id="@+id/taskStatus" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textColor="#000000" 
       android:textSize="20dip" > 
      </TextView> 

      <TextView 
       android:id="@+id/taskTime" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textColor="#000000" 
       android:textSize="20dip" > 
      </TextView> 
     </LinearLayout> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Completion notes: " 
      android:textColor="#000000" 
      android:textSize="18dip" > 
     </TextView> 

     <TextView 
      android:id="@+id/taskCompleteStatus" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:maxLines="10" 
      android:textColor="#000000" 
      android:textSize="15dip" > 
     </TextView> 

     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Cancellation notes: " 
      android:textColor="#000000" 
      android:textSize="18dip" > 
     </TextView> 

     <TextView 
      android:id="@+id/taskCancelStatus" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textColor="#000000" 
      android:textSize="15dip" > 
     </TextView> 
    </LinearLayout> 

</ScrollView> 

感謝!

答えて

3

プロジェクトを掃除して完全に再構築してください。私はこれまで、リソースがいくつかの変更の後に振る舞うように見える、このような奇妙な振る舞いを経験しました。

+0

ありがとうございます...その理由は何ですか? – siraj

+1

同意します。それは起こる –

+0

それはソフトウェアのバグを呼び出します。理由は何ですか? –

関連する問題