RecyclerView inside ScrollView, some items are not shown

I had a RecyclerView in ScrollView like this:


    <!--other stuff-->




    <!--other stuff-->


And the RecyclerView‘s item is a RelativeLayout, inside of which there is an EditText and other views. The layout_height of that RelativeLayout and EditText is both wrap_content. User can input into that EditText without any limit of length/lines so that each item’s height is different.

  • Run Button Grayed out: Android Studio
  • Android SAX parser not getting full text from between tags
  • Android open file
  • Layout width equal height
  • Fragments within Fragments
  • Android Rotate Picture before saving
  • Then I found that getItemCount() in Adapter returns true value but onBindViewHolder() is called of wrong times(less than it should be), thus not enough to show all items.

    I found that this will happen only if I wrote recyclerView.setNestedScrollingEnabled(false). But I cannot remove this line. Because if I did so, the RecyclerView won’t scroll smoothly and is not harmonious with other views inside ScrollView and ScrollView itself.

    This occurs on 6.0 but not on 4.1.

    I communicated with Google at this page: and he told me this is a bug fix for RecyclerView. You can visit that page so that you can understand the question and my goal better(There is a small sample project to show the problem there). I don’t agree with him even now and I want to solve the problem. Please help, thank you in advance.

    Related posts:

    Add Words to Android&#039;s UserDictionary
    Synchronizing partial database model from server to client
    How to place buttons over Image in android?
    Android Two finger rotation
    Android MVP open Activity from Presenter, anti-pattern?
    Preference On Change Listener
  • Facebook Canvas App in WebView not working on Android (in native facebook app)
  • Does Google Play In-App Billing Version 3 support refunds?
  • The following processes: -cmd.exe -java.exe are locking the following directory:
  • How to hide a button programmatically?
  • SpannableString not displayed correctly in Landscape mode
  • Android MapView overlaps DrawerLayout
  • One Solution collect form web for “RecyclerView inside ScrollView, some items are not shown”

    I found the solution myself: replace ScrollView with NestedScrollView and keep recyclerView.setNestedScrollingEnabled(false). I don’t know if this is what NestedScrollView is made for but it works.


    1. NestedScrollView is not a child of ScrollView but of FrameLayout.
    2. This solution will also bring some bugs with self-simulated adjustResize.
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.