想做一个界面
上面是listview, 可以上下拖动查看全部数据下面是一横排的按钮, 并且是固定占住下面的位置我的实现方式是<LinearLayout>
<ScrollView android:layout_height="400dip" >
<ListView>
                </ListView>
</ScrollView> <LinearLayout/>
             按钮放这里面
</LinearLayout>
</LinearLayout>但是 这样的话, SV和LV两个控件不兼容, 会出现bug。 虽然可以用控制LISTVIEW高度的方法解决, 可是还是不太好;
有没有更好的方法???

解决方案 »

  1.   

    菜单栏用gridview<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent">
      <GridView //下面菜单栏
       android:layout_width="fill_parent"
       android:layout_height="wrap_content"
       android:id="@+id/toolbar_grid"
       android:layout_alignParentBottom="true"/>
      <ListView //listview
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       android:id="@+id/listview"
       android:layout_above="@id/toolbar_grid"/>
      </RelativeLayout>
      

  2.   

    ListView用的着外面套个ScrollView?ListView的item很多时会自动添加滚动条
      

  3.   

    ScrollView 干什么用的?listview自己可以滚动的。
      

  4.   

    楼上说的是,listview没必要用 ScrollView 。listview 加上这个属性 android:layout_weight="1" 即可。