Showup strange space (gap) when use RecyclerView inside NestedScrollview









up vote
0
down vote

favorite












I'm trying to build a BottomSheet that contains a RecyclerView in it. I used a NestedScrollView and set its behavior as "bottom_sheet_behavior". The first time the app run, it's popping up normally, but when I collapse the BottomSheet and select an item from the spinner, it popping up with a space below it.



This is just happening on android 8, not the other versions.
On the other hand, when I remove RecyclerView, it works normally.



<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<com.toptoche.searchablespinnerlibrary.SearchableSpinner
android:id="@+id/spinner"
android:layout_width="200dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginTop="200dp"
android:background="#c9c5c5"
android:elevation="8dp"
android:entries="@array/seasons"
android:layoutDirection="rtl"
android:spinnerMode="dialog"
android:textAlignment="center"
android:textDirection="rtl" />

</LinearLayout>

<android.support.v4.widget.NestedScrollView
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="300dp"
android:fillViewport="true"
android:background="@color/colorPrimary"
android:elevation="6dp"
app:layout_behavior="@string/bottom_sheet_behavior">

<android.support.v7.widget.RecyclerView
android:id="@+id/activity_Recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</android.support.v4.widget.NestedScrollView>

</android.support.design.widget.CoordinatorLayout>


First run



After select an item from spinner










share|improve this question



























    up vote
    0
    down vote

    favorite












    I'm trying to build a BottomSheet that contains a RecyclerView in it. I used a NestedScrollView and set its behavior as "bottom_sheet_behavior". The first time the app run, it's popping up normally, but when I collapse the BottomSheet and select an item from the spinner, it popping up with a space below it.



    This is just happening on android 8, not the other versions.
    On the other hand, when I remove RecyclerView, it works normally.



    <?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.toptoche.searchablespinnerlibrary.SearchableSpinner
    android:id="@+id/spinner"
    android:layout_width="200dp"
    android:layout_height="40dp"
    android:layout_gravity="center"
    android:layout_marginTop="200dp"
    android:background="#c9c5c5"
    android:elevation="8dp"
    android:entries="@array/seasons"
    android:layoutDirection="rtl"
    android:spinnerMode="dialog"
    android:textAlignment="center"
    android:textDirection="rtl" />

    </LinearLayout>

    <android.support.v4.widget.NestedScrollView
    android:id="@+id/bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="300dp"
    android:fillViewport="true"
    android:background="@color/colorPrimary"
    android:elevation="6dp"
    app:layout_behavior="@string/bottom_sheet_behavior">

    <android.support.v7.widget.RecyclerView
    android:id="@+id/activity_Recycler"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

    </android.support.v4.widget.NestedScrollView>

    </android.support.design.widget.CoordinatorLayout>


    First run



    After select an item from spinner










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to build a BottomSheet that contains a RecyclerView in it. I used a NestedScrollView and set its behavior as "bottom_sheet_behavior". The first time the app run, it's popping up normally, but when I collapse the BottomSheet and select an item from the spinner, it popping up with a space below it.



      This is just happening on android 8, not the other versions.
      On the other hand, when I remove RecyclerView, it works normally.



      <?xml version="1.0" encoding="utf-8"?>
      <android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

      <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical">

      <com.toptoche.searchablespinnerlibrary.SearchableSpinner
      android:id="@+id/spinner"
      android:layout_width="200dp"
      android:layout_height="40dp"
      android:layout_gravity="center"
      android:layout_marginTop="200dp"
      android:background="#c9c5c5"
      android:elevation="8dp"
      android:entries="@array/seasons"
      android:layoutDirection="rtl"
      android:spinnerMode="dialog"
      android:textAlignment="center"
      android:textDirection="rtl" />

      </LinearLayout>

      <android.support.v4.widget.NestedScrollView
      android:id="@+id/bottom_sheet"
      android:layout_width="match_parent"
      android:layout_height="300dp"
      android:fillViewport="true"
      android:background="@color/colorPrimary"
      android:elevation="6dp"
      app:layout_behavior="@string/bottom_sheet_behavior">

      <android.support.v7.widget.RecyclerView
      android:id="@+id/activity_Recycler"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" />

      </android.support.v4.widget.NestedScrollView>

      </android.support.design.widget.CoordinatorLayout>


      First run



      After select an item from spinner










      share|improve this question















      I'm trying to build a BottomSheet that contains a RecyclerView in it. I used a NestedScrollView and set its behavior as "bottom_sheet_behavior". The first time the app run, it's popping up normally, but when I collapse the BottomSheet and select an item from the spinner, it popping up with a space below it.



      This is just happening on android 8, not the other versions.
      On the other hand, when I remove RecyclerView, it works normally.



      <?xml version="1.0" encoding="utf-8"?>
      <android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

      <LinearLayout
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical">

      <com.toptoche.searchablespinnerlibrary.SearchableSpinner
      android:id="@+id/spinner"
      android:layout_width="200dp"
      android:layout_height="40dp"
      android:layout_gravity="center"
      android:layout_marginTop="200dp"
      android:background="#c9c5c5"
      android:elevation="8dp"
      android:entries="@array/seasons"
      android:layoutDirection="rtl"
      android:spinnerMode="dialog"
      android:textAlignment="center"
      android:textDirection="rtl" />

      </LinearLayout>

      <android.support.v4.widget.NestedScrollView
      android:id="@+id/bottom_sheet"
      android:layout_width="match_parent"
      android:layout_height="300dp"
      android:fillViewport="true"
      android:background="@color/colorPrimary"
      android:elevation="6dp"
      app:layout_behavior="@string/bottom_sheet_behavior">

      <android.support.v7.widget.RecyclerView
      android:id="@+id/activity_Recycler"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" />

      </android.support.v4.widget.NestedScrollView>

      </android.support.design.widget.CoordinatorLayout>


      First run



      After select an item from spinner







      android android-studio android-recyclerview bottom-sheet






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 15:39









      André Sousa

      1,092818




      1,092818










      asked Nov 8 at 23:01









      Pitok

      13




      13






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          After a long effort finally found the problem. That was because of using this library ==> Searchable Spinner . I replaced it with simple spinner and it works fine!




          Point:: Always use updated and supported libraries :|







          share|improve this answer




















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53217468%2fshowup-strange-space-gap-when-use-recyclerview-inside-nestedscrollview%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote



            accepted










            After a long effort finally found the problem. That was because of using this library ==> Searchable Spinner . I replaced it with simple spinner and it works fine!




            Point:: Always use updated and supported libraries :|







            share|improve this answer
























              up vote
              0
              down vote



              accepted










              After a long effort finally found the problem. That was because of using this library ==> Searchable Spinner . I replaced it with simple spinner and it works fine!




              Point:: Always use updated and supported libraries :|







              share|improve this answer






















                up vote
                0
                down vote



                accepted







                up vote
                0
                down vote



                accepted






                After a long effort finally found the problem. That was because of using this library ==> Searchable Spinner . I replaced it with simple spinner and it works fine!




                Point:: Always use updated and supported libraries :|







                share|improve this answer












                After a long effort finally found the problem. That was because of using this library ==> Searchable Spinner . I replaced it with simple spinner and it works fine!




                Point:: Always use updated and supported libraries :|








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 9 at 16:10









                Pitok

                13




                13



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53217468%2fshowup-strange-space-gap-when-use-recyclerview-inside-nestedscrollview%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

                    Edmonton

                    Crossroads (UK TV series)