Android滚动视图未填充父视图 [英] Android scrollview not filling parent view

查看:64
本文介绍了Android滚动视图未填充父视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下包含滚动视图的布局.在屏幕尺寸大于4.8之后,视图底部会有一个白色区域.为什么当我将scrollview指定为fill_parent时,为什么会这样?

I have the following layout that contains a scrollview. After screen sizes greater than around 4.8" there is a white area at the bottom of the view. Why is this, when i have specified the scrollview to fill_parent?

谢谢.

注意,您不能在下面的屏幕截图的菜单下方看到空白,因为它是白色的,很抱歉.大约有一个n英寸或2个空格的回合

NB you can't see the white space below the menu on the screenshot below as it's white, sorry. There is a bout a n inch or 2 of space

 <?xml version="1.0" encoding="utf-8"?>


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



    <LinearLayout 
        android:id="@+id/ll1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/carefreebgscaledlighting"
        android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res/android">




        <TextView
            android:id="@+id/textviewcompanyname"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#003F87" />

        <TextView
            android:id="@+id/textViewYouAreSignedIn"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_alignParentTop="true"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#003F87"
             />

              <TextView
            android:id="@+id/textViewUnsentTransactions"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_below="@id/textViewYouAreSignedIn"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#003F87"
             />

        <TextView
            android:id="@+id/spacerasnexttextviewclasheswithbg"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:textAppearance="?android:attr/textAppearanceLarge"
             />

        <LinearLayout

            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <ImageView 
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/imagesignaltower"
                android:background="@drawable/signaltower"/>

            <ProgressBar
            android:id="@+id/progressBarSignal"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:progressDrawable="@drawable/progressbar2"
            android:layout_marginTop="10dp" />

        </LinearLayout>


        <TextView
            android:id="@+id/textview1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:text="@string/stringloggedinscreen"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:textColor="#003F87" />

    <Button
        android:id="@+id/buttonsignin"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="@string/stringbuttonsignin"
         />

.........
...........
...........
</LinearLayout>
    </ScrollView>

.

推荐答案

添加到您的ScrollView:

android:fillViewport="true"

这篇关于Android滚动视图未填充父视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆