0

我有这样的问题。我在回收站视图中的所有图像都转移到右侧。 截屏 这是我的适配器

    adapter = new GalleryAdapter(new ArrayList<>(), galleryImage -> galleryLocationPresenter.openGallery(galleryImage), getContext());
    adapter.setHasStableIds(true);
    recyclerView.addItemDecoration(new ListSpacingDecoration(Helpers.dpToPx(15, getContext())));
    staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
    staggeredGridLayoutManager.setGapStrategy(StaggeredGridLayoutManager.GAP_HANDLING_NONE);
    recyclerView.setLayoutManager(staggeredGridLayoutManager);
    recyclerView.setAdapter(adapter);

这是我的行视图

<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardCornerRadius="2dp">

<ImageView
    android:id="@+id/image"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:scaleType="centerCrop" />
</android.support.v7.widget.CardView>

我也尝试过差距策略GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS。同样的事情。

4

0 回答 0