2012-02-14 71 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