2017-04-10 56 views
0

當我向下滾動時,不必要的空格即將到來,所以請幫助我,我正在使用此活動的scrollView。這是我的.xml文件,請參閱它並建議我該做什麼,因爲當我滾動下來的不必要的空間,使我的應用噁心。避免在滾動視圖中向下滾動時出現空格

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:fitsSystemWindows="true" 
android:fillViewport="true"> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:orientation="vertical" 
android:layout_height="match_parent" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="5dp" 
android:paddingRight="5dp" 
tools:context="com.example.vishal.a4sa.rubber"> 

<TextView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:textAppearance="?android:attr/textAppearanceLarge" 
    android:text="Rubber Bowl" 
    android:gravity="center" 
    android:textColor="#01118c" 
    android:padding="@dimen/activity_horizontal_margin" 
    android:textStyle="bold" 
    android:textSize="30dp" 
    android:id="@+id/tv" 
    android:layout_alignParentTop="true" 
    android:layout_centerHorizontal="true" /> 

<ImageView 
    android:layout_width="match_parent" 
    android:layout_height="300dp" 
    android:id="@+id/image" 
    android:background="@drawable/image1" 
    android:layout_below="@+id/textView5" 
    android:layout_alignParentLeft="true" 
    android:layout_alignParentStart="true" /> 

<android.support.v4.widget.Space 
    android:layout_width="match_parent" 
    android:layout_height="8dp" /> 


<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="900dp" 
    android:textAppearance="?android:attr/textAppearanceMedium" 
    android:textColor="#000000" 
    android:id="@+id/content" 
    android:layout_alignParentBottom="true" 
    android:layout_alignLeft="@+id/imageView" 
    android:layout_alignStart="@+id/imageView" /> 

    </LinearLayout> 
    </ScrollView> 
+0

你可以把一個屏幕截圖? –

+0

你在你的'LinearLayout'中填充了內容' 刪除它並且它應該可以工作'android:paddingBottom =「@dimen/activity_vertical_margin」' –

回答

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

    <LinearLayout 
      android:layout_width="match_parent" 
      android:orientation="vertical" 
      android:layout_height="match_parent" 
      android:paddingLeft="5dp" 
      android:paddingRight="5dp"> 

      <TextView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:textAppearance="?android:attr/textAppearanceLarge" 
       android:text="Rubber Bowl" 
       android:gravity="center" 
       android:textColor="#01118c" 
       android:padding="@dimen/activity_horizontal_margin" 
       android:textStyle="bold" 
       android:textSize="30dp" 
       android:id="@+id/tv" 
       android:layout_alignParentTop="true" 
       android:layout_centerHorizontal="true" /> 

      <ImageView 
       android:layout_width="match_parent" 
       android:layout_height="300dp" 
       android:id="@+id/image" 
       android:background="@drawable/image1" 
       android:layout_below="@+id/textView5" 
       android:layout_alignParentLeft="true" 
       android:layout_alignParentStart="true" /> 

      <android.support.v4.widget.Space 
       android:layout_width="match_parent" 
       android:layout_height="8dp" /> 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:textAppearance="?android:attr/textAppearanceMedium" 
       android:textColor="#000000" 
       android:id="@+id/content" 
       android:layout_alignParentBottom="true" 
       android:layout_alignLeft="@+id/imageView" 
       android:layout_alignStart="@+id/imageView" /> 

    </LinearLayout> 
</ScrollView> 
相關問題