2012-09-25 7 views
1

내가 같이있는 ScrollView의 내부에있는 ScrollView와 TableLayout을 사용하려고 작동하지 않습니다안드로이드 :있는 ScrollView가 TableLayout을

<ScrollView 
    android:id="@+id/scrollView1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_margin="10dp" > 

    <TableLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" > 

     <TableRow 
      android:id="@+id/tableRow1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" > 

      <TextView 
       android:id="@+id/textView1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="Input text: " /> 

      <EditText 
       android:id="@+id/weightEditText" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:inputType="numberDecimal" > 

       <requestFocus /> 
      </EditText> 
     </TableRow> 

    </TableLayout> 

</ScrollView> 

그러나이 작동하지 않습니다. 내 콘텐츠가 너무 크면 스크롤 막대가 표시되지 않습니다. 누구든지 이런 식으로 작동하는 이유는 무엇입니까?

답변

3

같이 match_parent 할 수있는 ScrollView layout_height를 변경해보십시오 :

<ScrollView 
    android:id="@+id/scrollView1" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_margin="10dp" > 

당신은 화면이 끝날 때도있는 ScrollView 그냥 더 성장할 것이다 wrap_content 사용하지만있는 ScrollView를 match_parent 사용할 때 화면에 맞게하고

스크롤 뷰의 내용이 오버플로되면 스크롤 막대가 표시됩니다.

롤프

+0

감사합니다. – JavaRunner

관련 문제