2011-07-14 61 views
0

我在我的應用程序中使用了一個滾動視圖,如下所示。但屏幕的底部並不是完全可見的,即使我已儘可能向下滾動。我做錯了什麼或者有什麼方法可以解決這個問題?ScrollView不會一直向下滾動

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <Button  
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:text="Name" 
     /> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:fillViewport="true"> 

     <LinearLayout  
     android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_gravity="center_horizontal" > 

       <TableLayout 
       android:layout_height="wrap_content" 
       android:layout_width="fill_parent" 
       android:layout_centerHorizontal="true"> 

        <TableRow> 
        <TextView 
         android:layout_height="wrap_content" 
         android:layout_width="wrap_content" 
         android:text="name"> 
        </TextView> 
        <EditText 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_weight="1" 
         > 
        </EditText> 
        </TableRow> </TableLayout> </LinearLayout> </ScrollView> 

+0

滾動視圖直到屏幕底部的最後一項纔會停止。 – realuser

+1

我不知道爲什麼有些人表現出對負面投票和評論而不是回答的興趣。 – Randroid

回答

0

試試這個

scrollview.scrollTo(0, scrollview.getBottom()); 
0

一旦我有同樣的問題
您可以通過
scrollview.scrollTo(0, scrollview.getBottom());
在底部設置滾動位置,如果它不工作,我覺得問題與您的AVD,所以請更改您的AVD的屏幕尺寸Android SDK and AVD Manager。選擇您的AVD,並通過檢查Scaledisplay to real size以適當的大小啓動它。

相關問題