Не могу увидеть конец сообщения в моем обзоре полностью - PullRequest
0 голосов
/ 11 апреля 2020

Это канал, в котором я использовал recyclerview в домашнем фрагменте для показа сообщений, но в нем я не вижу полностью последнее сообщение, и если я добавляю текстовое представление ниже, которое все еще не может его просмотреть.

Here is the image Как показано на изображении, я не вижу аналогичного комментария и кнопки «Поделиться» в последнем сообщении

Я попытался поместить текстовое представление внутрь и обратно, но все еще здесь не работает код фрагмента и действия:

фрагмент:

<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/light_grey">

    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
        android:id="@+id/pullToRefresh"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="?attr/actionBarSize"
        />
    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

    <Space
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:id="@+id/spppp"
        android:layout_below="@+id/pullToRefresh"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/homeend"
        android:layout_below="@id/spppp"
        android:fontFamily="@font/nunito"
        android:layout_centerHorizontal="true"/>

</RelativeLayout>

активность:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/add_post_btn"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:clickable="true"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.954"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintVertical_bias="0.88"
        app:srcCompat="@android:drawable/ic_input_add" />

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/nav_view"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="0dp"
        android:layout_marginEnd="0dp"
        android:background="?android:attr/windowBackground"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:menu="@menu/bottom_nav_menu" />

    <fragment
        android:id="@+id/nav_host_fragment"
        android:name="androidx.navigation.fragment.NavHostFragment"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:defaultNavHost="true"
        app:layout_constraintBottom_toTopOf="@id/nav_view"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navGraph="@navigation/mobile_navigation" />

</androidx.constraintlayout.widget.ConstraintLayout>

1 Ответ

2 голосов
/ 11 апреля 2020

Я думаю, что проблема в макете деятельности. Ваш фрагмент принимает ширину и высоту действия, но вы также отображаете нижнюю навигационную панель внизу, возможно, она скрывает часть фрагмента.

Попробуйте настроить свой фрагмент так, чтобы он заполнял действие, но также находился в верхней части нижней панели навигации. В настоящее время вы устанавливаете высоту фрагмента на match_parent, что делает его layout_constraintBottom_toTopOf="@id/nav_view" бесполезным.

<androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">


    <com.google.android.material.floatingactionbutton.FloatingActionButton />

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/nav_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent" />

    <fragment
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toTopOf="@id/nav_view"
        app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...