2014-04-05 64 views
1

嗨,我有我的滾動視圖的問題。我的佈局有兩個圖像視圖,一個在頂部,一個在底部,我希望我的滾動視圖在中間。我面臨的問題是底部圖像縮小,以適應元素作爲滾動視圖不起作用。我的代碼如下。提前感謝滾動查看無效?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:id="@+id/core" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/cd_corelbg" 
    android:orientation="vertical"> 

    <ImageView 
     android:id="@+id/imageViewhead" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentTop="true" 
     android:adjustViewBounds="true" 
     android:src="@drawable/cd_corehead" /> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:orientation="vertical" > 

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


    <ImageView 
     android:id="@+id/imageViewheading1" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/imageViewhead" 
     android:contentDescription="heading1" 
     android:src="@drawable/cd_corheading1" /> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 
    <ImageView 
     android:id="@+id/imageViewheading1" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/imageViewhead" 
     android:contentDescription="heading1" 
     android:src="@drawable/cd_coreback2" 
     android:paddingLeft="10dp" 
     android:paddingRight="10dp"/> 
    </LinearLayout> 

     <ImageView 
     android:id="@+id/imageViewheading1" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/imageViewhead" 
     android:contentDescription="heading1" 
     android:src="@drawable/cd_coredlheading1" /> 

     <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="horizontal"> 
    <ImageView 
     android:id="@+id/imageViewheading1" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentLeft="true" 
     android:layout_below="@+id/imageViewhead" 
     android:contentDescription="heading1" 
     android:src="@drawable/cd_coreback2" 
     android:paddingLeft="10dp" 
     android:paddingRight="10dp"/> 
    </LinearLayout> 

</LinearLayout> 
</ScrollView>  

<RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <ImageView 
     android:id="@+id/imageViewbase" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentBottom="true" 
     android:adjustViewBounds="true" 
     android:src="@drawable/cd_cor" /> 
    </RelativeLayout> 
</LinearLayout> 
+1

你能給個截圖嗎 –

回答

0

嗨使您的主佈局作爲相對佈局。並且還提供了滾動視圖的條件,使得對齊頂部圖像下方,並且對齊上方底部圖像也可以將底部圖像設置爲對齊父級底部。