Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android RelativeLayout中的ListView填充整个高度_Android_Xml_Listview_Android Linearlayout_Android Relativelayout - Fatal编程技术网

Android RelativeLayout中的ListView填充整个高度

Android RelativeLayout中的ListView填充整个高度,android,xml,listview,android-linearlayout,android-relativelayout,Android,Xml,Listview,Android Linearlayout,Android Relativelayout,我有一个主要的相对布局,其中有一个ListView和另一个水平线布局,我想放在屏幕底部。 当列表视图中的项目填满屏幕时,它将隐藏在水平线性布局下。 如何限制ListView只占用水平线性布局之前的空间,并阻止列表视图的内容隐藏 谢谢你的帮助和建议 这是我的布局和屏幕截图 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/

我有一个主要的相对布局,其中有一个ListView和另一个水平线布局,我想放在屏幕底部。 当列表视图中的项目填满屏幕时,它将隐藏在水平线性布局下。 如何限制ListView只占用水平线性布局之前的空间,并阻止列表视图的内容隐藏

谢谢你的帮助和建议

这是我的布局和屏幕截图

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_chat_window"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.raoburugula.speech_soft_ivr.ChatWindow">
            <ListView
                android:id="@+id/lvMessages"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:divider="@android:color/transparent"
                android:dividerHeight="5dp"
                />

    <LinearLayout
        android:id="@+id/llAction"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_alignParentBottom="true"
        android:weightSum="5"
        android:visibility="invisible">
        <EditText
            android:id="@+id/etMessage"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="4"/>

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/btnSendMessage"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:src="@drawable/ic_send"
            android:tint="@android:color/white"
            android:onClick="sendMessage"
             />
    </LinearLayout>
</RelativeLayout>


我将从LinearLayout中删除android:visibility=“invisible”
行。并检查其工作原理。有一次,我还自下而上构建了布局,允许我在屏幕底部放置两个按钮,事后看来,我可能不需要这样做。我无法对你的帖子发表评论,所以我回答了这个问题


你也试过用普通按钮代替FAB(浮动动作按钮)吗?晶圆厂可能具有使其可见且位于右下角的属性,而不考虑其父属性

您使水平线布局与父属性的底部对齐,是的


您必须使listView位于水平线布局上方。

我需要可见性属性,因为我正在控制它,我相信这个问题与此无关。还有,晶圆厂是如何对此产生影响的。?这与相对布局以及如何在其中放置小部件有关。很抱歉我误读了它,因为linearlayout没有出现,这家伙问了一个类似的问题,他们建议在根布局中为按钮和listview创建一个布局,以便将listview包装在一个RelativeLayout中,并使该布局与父布局的顶部和包含EditText和Button的LinearLayout的顶部对齐