2012-02-14 21 views
0

嗨,目前我真的很努力爲我的android應用程序獲得一個不錯的佈局。 我製作了一個包含scrollview的頁眉和頁腳的視圖,嘗試了很多情況,但是我所有的底部條從我的滾動視圖中消失了。Android Layout topbar> scrollview>廣告欄

爲了讓事情更加清楚香港專業教育學院做了什麼i'dd像一個簡單的圖像它是:

Mockup

提前感謝!

回答

2

試試這個

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent">  

    <RelativeLayout 
     android:id="@+id/toplayout" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 

      <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"  
      android:text="TopBar"/> 
    </RelativeLayout> 

    <RelativeLayout 
      android:id="@+id/bottomlayout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentBottom="true"> 

      <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"  
      android:text="Bottom Bar"/> 
    </RelativeLayout> 

    <ScrollView 
      android:id="@+id/scrolllayout" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/toplayout" 
      android:layout_above="@id/bottomlayout"> 
     <RelativeLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center_horizontal"> 
     <ImageView 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:background="@drawable/icon01" 
       android:id="@+id/lin1"/> 
     </RelativeLayout> 
    </ScrollView> 


</RelativeLayout> 
+0

真棒作品就像一個魅力 – sn0ep 2012-02-14 09:52:05