Мой XML-код recyclerview:
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:id="@+id/blogrow"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_gravity="center_vertical"
/>
, а мой код CardView:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="120dp"
android:layout_height="160dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#fff"
app:cardCornerRadius="2dp"
android:layout_gravity="center"
app:cardElevation="0dp"
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
android:layout_marginBottom="4dp"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/profilePostImage"
/>
</LinearLayout>
Я использовал диспетчер сетки:
mgridLayoutManager = new GridLayoutManager(getActivity(),2);
mgridLayoutManager.setReverseLayout(true);
Проблема в том, что изображения, которые я получаю, имеют неравномерное заполнение.Например, левый отступ для изображений левого столбца меньше.Между двумя столбцами имеется большое количество отступов.И в правой части изображения есть огромное количество отступов.Как исправить так, чтобы столбцы имели четные отступы?