<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/list_selector"
    android:padding="5dip" >    
    <RelativeLayout
        android:id="@+id/rl_bottom"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" >        <Button
            android:id="@+id/group_discuss_submit"
            android:layout_width="60dp"
            android:layout_height="40dp"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginRight="10dp"
            android:background="@drawable/chat_send_button_bg"
            android:onClick="discussSubmit"
            android:text="发送"
            android:textSize="20sp" />        <EditText
            android:id="@+id/group_discuss"
            android:layout_width="fill_parent"
            android:layout_height="40dp"
            android:layout_centerVertical="true"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_toLeftOf="@id/group_discuss_submit"
            android:hint="评论"
            android:singleLine="true"
            android:textSize="18sp" >
            <requestFocus />
        </EditText>
    </RelativeLayout>
    <ListView
        android:id="@+id/group_discuss_list"
        android:layout_width="fill_parent"
        android:layout_height="fill_content"
        android:layout_alignParentRight="true"
       android:layout_above="@id/rl_bottom"
        android:layout_marginTop="14dp"
        android:divider="#b5b5b5"
        android:dividerHeight="1dp"
        android:listSelector="@drawable/list_selector" />
</RelativeLayout>改成这样。

解决方案 »

  1.   

    我按照这个增加了一个android:layout_above="@id/rl_bottom",如果评论列表太长,就成了listview自己带下拉条了,不能看到所有评论,这个页面效果显然是不太好.
    显然是希望整个页面自动向下延展的啊
      

  2.   

    现在edittext和button已经是在底部了啊。只是背景是透明的,所以看着很乱,把edittext所在的layout的背景设置一下就可以。<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="horizontal" >
        <ListView
            android:id="@+id/group_discuss_list"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:layout_marginTop="14dp"
            android:divider="#b5b5b5"
            android:dividerHeight="1dp"
            android:padding="5dp" />
     
        <RelativeLayout
            android:id="@+id/rl_bottom"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:background="#f0f0f0" >
     
            <Button
                android:id="@+id/group_discuss_submit"
                android:layout_width="60dp"
                android:layout_height="40dp"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginRight="10dp"
                android:onClick="discussSubmit"
                android:text="发送"
                android:textSize="20sp" />
     
            <EditText
                android:id="@+id/group_discuss"
                android:layout_width="fill_parent"
                android:layout_height="40dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:layout_toLeftOf="@id/group_discuss_submit"
                android:hint="评论"
                android:singleLine="true"
                android:textSize="18sp" >
                <requestFocus />
            </EditText>
        </RelativeLayout>
    </RelativeLayout>
      

  3.   

    我按照这个增加了一个android:layout_above="@id/rl_bottom",如果评论列表太长,就成了listview自己带下拉条了,不能看到所有评论,这个页面效果显然是不太好.
    显然是希望整个页面自动向下延展的啊你又希望Listview不要有滚动条,又要让其它的控件不会被挤出界面,这是不可能啊,界面就这么大,如果listview太长肯定会被挤出界面啊,除非你把下面的布局放到上面,那个下面的ListView滚动,你是要让马儿跑又不让马儿吃草。
      

  4.   

    你可以试试整个用ScrollView。每有一条评论就add一次。然后把那个底部布局放到ScrollView下边。临时想到的。。你试试吧…
      

  5.   

    或者干脆把最上边  这条状态的信息也放到ListView里边的第一条。从第二个item开始加载评论。这样整个布局就是一个ListView和一个底部的布局了。我之前是这样写的。