Why recyclerView is not visible under scrollView?
Why recyclerView is not visible under scrollView?
I want a layout in which I need recyclerView in between two views and for scrolling all, i need scrollView. I have created a sample program in which i have used below xml:
Now, I don't understand why recyclerView is not visible when i run this program?
It is visible if I am not use scrollView.
Answer by Chintan Bawa for Why recyclerView is not visible under scrollView?
Replace your xml
with xml
below.
Answer by Tafveez Mehdi for Why recyclerView is not visible under scrollView?
Technically you should not place a scrollable view inside a scrollable view. This means, you cannot put RecyclerView inside ScrollView.
Answer by Ravi Rupareliya for Why recyclerView is not visible under scrollView?
you have given height of you main layout to wrap_content
, change it to match_parent
Answer by Vatish Sharma for Why recyclerView is not visible under scrollView?
Here is the correct xml for my problem:
and for recycler view to allow scroll with other items of scrollView , we have to give recyclerView height at runtime by setting its LayoutParams. Like for 100 TextView of 50dp each, the recyclerView Height will be:
mRecyclerView = (RecyclerView) findViewById(R.id.mRecycler); float density = getResources().getDisplayMetrics().density; mRecyclerView.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, ((int) (density * 50)) * 100));
It will work fine :)
Answer by Mohamed Ramadan for Why recyclerView is not visible under scrollView?
try to use this you don't need to use scrollview and u can't place scrollable view in scrollableview https://github.com/blipinsk/RecyclerViewHeader
Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72
0 comments:
Post a Comment