开发者

ScrollView not scrolling all the way down

I'm using a scrollview in my app as follows. But bottom part of the screen is not completely visible, even when I have scrolled down as far as possible. What am I doing wrong or is there a way to fix this?

<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"
                        a开发者_Python百科ndroid:layout_weight="1"
                        >
                    </EditText>
                    </TableRow> </TableLayout>   </LinearLayout> </ScrollView>


Try this

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


Once I had the same issue
You can set scroll position at bottom by
scrollview.scrollTo(0, scrollview.getBottom());
if it is not working, i think the problem is with your AVD, so make change your AVD's screen size by Android SDK and AVD Manager. Select Your AVD and start it with checking Scaledisplay to real size to appropriate size.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜