android - RecyclerView inside ScrollView, some items are not shown -


i had recyclerview in scrollview this:

<scrollview     android:layout_width="match_parent"     android:layout_height="match_parent">      <!--other stuff-->      <linearlayout         android:layout_width="match_parent"         android:layout_height="wrap_content">          <android.support.v7.widget.recyclerview             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:visibility="gone"/>      </linearlayout>      <!--other stuff-->  </scrollview> 

and recyclerview's item relativelayout, inside of there edittext , other views. layout_height of relativelayout , edittext both wrap_content. user can input edittext without limit of length/lines each item's height different.

then found getitemcount() in adapter returns true value onbindviewholder() called of wrong times(less should be), not enough show items.

i found happen if wrote recyclerview.setnestedscrollingenabled(false). cannot remove line. because if did so, recyclerview won't scroll smoothly , not harmonious other views inside scrollview , scrollview itself.

this occurs on 6.0 not on 4.1.

i communicated google @ page: https://code.google.com/p/android/issues/detail?id=213914 , told me bug fix recyclerview. can visit page can understand question , goal better(there small sample project show problem there). don't agree him , want solve problem. please help, thank in advance.

i found solution myself: replace scrollview nestedscrollview , keep recyclerview.setnestedscrollingenabled(false). don't know if nestedscrollview made works.

notice:

  1. nestedscrollview not child of scrollview of framelayout.
  2. this solution bring bugs self-simulated adjustresize.

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -