当回收站视图中的数据项增加时,回收站视图数据将位于文本视图下

莫希特·高尔(Mohit gaur)

我正在创建一个聊天应用程序。在聊天室活动中,回收者视图项位于文本视图下。我的意思是,当数据项增加时,它位于文本视图下。

下面是屏幕截图

activty_chatroom.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="com.boosterfoxindia.foxindtracker.ChatRoomActivity">

    <!--<TextView-->
        <!--android:layout_width="wrap_content"-->
        <!--android:layout_height="wrap_content"-->
        <!--android:text="" -->
        <!--android:id="@+id/tvChat"/>-->

    <android.support.v7.widget.RecyclerView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/rvCM"
        app:stackFromEnd="true"></android.support.v7.widget.RecyclerView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:weightSum="7"
        android:layout_alignParentBottom="true"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:padding="0dp"
        android:gravity="center"
        >

        <EditText
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:id="@+id/etMessage"
            android:layout_weight="6"
            android:background="@drawable/chattextbox"
            android:padding="10dp"
            android:hint="Enter message..."
            android:elevation="2dp"
            android:layout_gravity="center"
            android:layout_marginTop="10dp"/>


        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:id="@+id/btnSend"
            android:background="@drawable/circle"
            android:orientation="vertical"
            android:gravity="center"
            android:layout_gravity="center"
            android:layout_marginTop="10dp"
            android:layout_marginLeft="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginBottom="0dp">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@mipmap/ic_send_white_24dp"
                android:layout_gravity="center"
                android:padding="10dp"
               />



        </LinearLayout>


    </LinearLayout>
</RelativeLayout>

我是android应用程序的初学者,因此我不知道我在哪里错,请帮帮我

杰伊·拉索德(Jay Rathod RJ)

我觉得你并不需要做出更多的改变你需要做的就是给一个idLinear Layout这样android:id="@+id/LLMain",它给Recycler View使用这个属性android:layout_above="@+id/LLMain"。而且也给height match parentRecyclerview

像这样的XML。

<android.support.v7.widget.RecyclerView
        android:id="@+id/rvCM"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/LLMain"
        app:stackFromEnd="true" />

    <LinearLayout
        android:id="@+id/LLMain"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="5dp"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:orientation="horizontal"
        android:padding="0dp"
        android:weightSum="7"> 

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

回收站视图错误

来自分类Dev

Android:在回收站视图中设置文本

来自分类Dev

无休止的回收站视图重复json数据

来自分类Dev

无休止的回收站视图重复json数据

来自分类Dev

当我从回收站视图中删除项目时,回收站视图没有刷新?

来自分类Dev

如何在Android中将数据从服务器显示到回收站视图中

来自分类Dev

如何在回收站视图中更新多个 sqlite 数据?

来自分类Dev

回收站视图不刷新

来自分类Dev

回收站视图滚动搞砸了

来自分类Dev

无法设置回收站视图

来自分类Dev

回收站视图位置比较

来自分类Dev

回收站视图不刷新

来自分类Dev

回收站视图(Xamarin Android)

来自分类Dev

回收站视图中的无线电组

来自分类Dev

如何在回收站视图中更改字体?

来自分类Dev

如何在Android的回收站视图中运行for循环?

来自分类Dev

滑动以在动态更新的回收站视图中关闭

来自分类Dev

限制要在回收站视图中显示的项目

来自分类Dev

项目未显示在回收站视图中

来自分类Dev

回收站视图中的单选单选按钮(重复)

来自分类Dev

在回收站视图中显示我的数据时出错:RecyclerView:未连接适配器;跳过布局

来自分类Dev

通过单击另一个回收站视图中的按钮刷新回收站视图

来自分类Dev

从回收站视图的适配器内重新加载回收站视图

来自分类Dev

如果回收站视图中的cardview项为null,则将其删除

来自分类Dev

当从搜索视图的过滤器中选择文本时,将先前的结果设置回回收站视图

来自分类Dev

在回收站视图中滚动时复选框状态不断变化

来自分类Dev

当我尝试在回收站视图中过滤列表时,为什么 filterResults 为 null?

来自分类Dev

回收站视图与滚动视图内的线性布局?

来自分类Dev

如何制作具有多个数据集的回收站视图?

Related 相关文章

  1. 1

    回收站视图错误

  2. 2

    Android:在回收站视图中设置文本

  3. 3

    无休止的回收站视图重复json数据

  4. 4

    无休止的回收站视图重复json数据

  5. 5

    当我从回收站视图中删除项目时,回收站视图没有刷新?

  6. 6

    如何在Android中将数据从服务器显示到回收站视图中

  7. 7

    如何在回收站视图中更新多个 sqlite 数据?

  8. 8

    回收站视图不刷新

  9. 9

    回收站视图滚动搞砸了

  10. 10

    无法设置回收站视图

  11. 11

    回收站视图位置比较

  12. 12

    回收站视图不刷新

  13. 13

    回收站视图(Xamarin Android)

  14. 14

    回收站视图中的无线电组

  15. 15

    如何在回收站视图中更改字体?

  16. 16

    如何在Android的回收站视图中运行for循环?

  17. 17

    滑动以在动态更新的回收站视图中关闭

  18. 18

    限制要在回收站视图中显示的项目

  19. 19

    项目未显示在回收站视图中

  20. 20

    回收站视图中的单选单选按钮(重复)

  21. 21

    在回收站视图中显示我的数据时出错:RecyclerView:未连接适配器;跳过布局

  22. 22

    通过单击另一个回收站视图中的按钮刷新回收站视图

  23. 23

    从回收站视图的适配器内重新加载回收站视图

  24. 24

    如果回收站视图中的cardview项为null,则将其删除

  25. 25

    当从搜索视图的过滤器中选择文本时,将先前的结果设置回回收站视图

  26. 26

    在回收站视图中滚动时复选框状态不断变化

  27. 27

    当我尝试在回收站视图中过滤列表时,为什么 filterResults 为 null?

  28. 28

    回收站视图与滚动视图内的线性布局?

  29. 29

    如何制作具有多个数据集的回收站视图?

热门标签

归档