0

我正在尝试在回收站视图中实现图像之间的导航,例如 instagram 故事;我的意思是,白线除以故事的数量。当你点击一个时,你得到了点击位置的图像。

我已经有了回收站视图,我试图放置一个图像叠加层来模拟白线,但我没有得到好的结果。

    recyclerView = (RecyclerView)findViewById(R.id.rv_evento_images);
    recyclerView.setLayoutManager(new LinearLayoutManager(this, HORIZONTAL, false));
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    recyclerView.setAdapter(imagesRecyclerAdapter);

我的xml:

<LinearLayout 
      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">
        <TextView
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:text="Bar"
            android:textSize="20sp"
            android:textColor="#FFFFFF" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_evento_images"
            android:layout_width="match_parent"
            android:layout_height="500dp"
            android:layout_marginTop="10dp"/>

需要的结果...

https://ibb.co/znd8vpB

4

1 回答 1

0

好吧,我为未来的观众找到了解决方案。

我认为“instagram 故事”是带有图像的回收站视图,但不是。该控件是一个设置图像视图背景的视图。

我用了一个库,StoriesProgressView这个!

它工作得很好,但取决于你需要什么功能。

于 2019-12-13T21:21:08.770 回答