Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RecyclerView automatically scrolls to WebView/Fresco SimpleDraweeView item

When I put an item with asynchronically loaded content with expandable height, such as WebView or Fresco's SimpleDraweeView, the view sometimes scrolls to this item (if it's for example just partially visible on the screen, it scrolls to it after item is loaded). Have someone experienced this issue?

like image 740
winiarro Avatar asked Mar 17 '16 09:03

winiarro


1 Answers

Put android:descendantFocusability="beforeDescendants" in your layout XML. This will prevent scrolling to asynchronously loaded contents.

<android.support.v7.widget.RecyclerView
            android:id="@+id/my_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:descendantFocusability="beforeDescendants" />
like image 189
DavidE Avatar answered Oct 20 '22 07:10

DavidE