Первый элемент (CardView) в моем RecyclerView (содержится в RelativeLayout) перекрывается верхней панелью действий. Как мне решить эту проблему?
<?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:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.goaandroidlessonslistmockup.MainActivity"> <!--Base RecyclerView--> <android.support.v7.widget.RecyclerView android:id="@+id/recyclerView" android:layout_width="match_parent" android:layout_height="match_parent" android:overScrollMode="never" android:background="@color/colorAccent" android:padding="4dp" android:scrollbars="vertical" /> </RelativeLayout>
Вы можете добавить это в свой RelativeLayout:
android:paddingTop="?attr/actionBarSize"
Ваша проблема в том, что ваш RelativeLayout отображается под панелью действий. Есть и другие решения, но, не видя ваших макетов, я не могу быть более конкретным.
RelativeLayout