我试图在回收器视图中实现图像之间的导航,就像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"/>
所需的结果。
发布于 2019-12-14 05:21:09
好吧,我为未来的观众找到了一个解决方案。
我以为"instagram stories“是一个带有图片的回收者视图,但事实并非如此。该控件是设置图像视图背景的视图。
我使用了一个库,StoriesProgressView this one!
它工作得很好,但这取决于你需要什么功能。
https://stackoverflow.com/questions/58278018
复制相似问题