Я не могу прокрутить мой RecyclerView до конца. Он отрезал мой последний элемент, и я не знаю почему. У меня есть другой RecyclerView в моем проекте, который также кажется сломанным. Не удается прокрутить RecyclerView
Вот мой код макета:
<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:id="@+id/container"
android:padding="10dp">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cv"
app:cardCornerRadius="2dp"
app:cardUseCompatPadding="true">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="220dp"
android:orientation="horizontal">
(...)
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/textView17"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="HISTORIA"
android:id="@+id/textView17"
android:layout_below="@+id/cv"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
Другой сломанной RecyclerView:
<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"
tools:context="com.praca_inz.Fragments.PetrolFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:scaleType="center"
android:src="@drawable/ic_editor_mode_edit"
android:layout_marginBottom="70dp"
android:layout_marginRight="15dp"
android:layout_marginEnd="15dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
Любые идеи, потому что у меня нет никаких.
Кажется, что ваш контент находится под слоем панели навигации. Использование CollapsingToolbarLayout в главном макете деятельности может вызвать эту проблему. –
@oguzhand У меня нет CollapsingToolbar. Вот мой макет MainActivity: http://pastebin.com/mPwvb0up Когда я удалил последнюю строку в приложении ViewPager 'app: layout_behavior =" @ string/appbar_scrolling_view_behavior "' Я получаю его так: http://i.imgur.com /JYI0j18.gif RecyclerView выглядит хорошо, но все остальное «выше». – user3448282
Моя ошибка, извините. Это был координаторLayout, а не CollapsingToolbarLayout. Есть некоторые ошибки, которые я видел при использовании. Один из них такой же, как ваш. Вы можете попытаться установить размер нижнего заполнения на высоте панели инструментов. Это может помочь в этом случае. –