【问题标题】:How to achieve navigation between images with control like instagram stories?如何通过 Instagram 故事等控件实现图像之间的导航?
【发布时间】:2020-02-05 05:58:20
【问题描述】:

我正在尝试在回收站视图中实现图像之间的导航,例如 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

【问题讨论】:

    标签: android android-recyclerview instagram-story


    【解决方案1】:

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

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

    我使用了一个库,StoriesProgressView this one!

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多