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
android android-studio android-recyclerview bottom-sheet
add a comment |
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
android android-studio android-recyclerview bottom-sheet
add a comment |
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
android android-studio android-recyclerview bottom-sheet
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
android android-studio android-recyclerview bottom-sheet
edited Nov 9 at 15:39
André Sousa
1,092818
1,092818
asked Nov 8 at 23:01
Pitok
13
13
add a comment |
add a comment |
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 :|
add a comment |
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 :|
add a comment |
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 :|
add a comment |
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 :|
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 :|
answered Nov 9 at 16:10
Pitok
13
13
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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