2011-07-14 58 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以适当的大小启动它。

相关问题