如何解决如何恢复 ScrollView 在 Fragment 中的位置?
我正在尝试在更改片段后恢复 ScrollView 的位置。 ScrollView 只是在更改 Fragments 后立即重置位置。我试图给 ScrollView 提供 ID 它没有效果。在我的 ScrollView 中还有一个 RecyclerView。下面提供的代码:
<ScrollView
android:id="@+id/homeScrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never">
<RelativeLayout
android:id="@+id/videoContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp">
<RelativeLayout
android:id="@+id/videoHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="8dp"
tools:ignore="RtlSymmetry">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/gilroysemibold"
android:text="Videos"
android:textAllCaps="true"
android:textColor="@color/colorLightGray"
android:textSize="18sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/videoBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/videoHeader"
android:layout_marginTop="10dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/videoRV"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:overScrollMode="never" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
感谢任何帮助。提前致谢
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。