当我放置一个包含异步加载内容且高度可扩展的项目,例如WebView或Fresco的SimpleDraweeView时,视图有时会滚动到此项目(例如仅在屏幕上部分可见时,在项目加载后滚动到它)。是否有人遇到过这个问题?
在您的布局XML中加入android:descendantFocusability="beforeDescendants"
。这将阻止滚动到异步加载的内容。
<android.support.v7.widget.RecyclerView
android:id="@+id/my_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="beforeDescendants" />