1

After update my support libraries 23.2.1, I encountered a problem. Even I didn't change any code only library update, my recyclerview item's become not shown. Only first item shown, others not shown. I have no idea why it is not show all elements. Is there anybody encounters this problem and how to fix it?

Before library update

After library update

Note: Unfortunaley I couldn't change my IDE Eclipse to Android Studio.

Aykut Uludağ
  • 1,876
  • 5
  • 18
  • 34

1 Answers1

2

There was a change in the support library 23.2.1

RecyclerView.LayoutManager no longer ignores some RecyclerView.LayoutParams settings, such as MATCH_PARENT in the scroll direction. Note: These lifted restrictions may cause unexpected behavior in your layouts. Make sure you specify the correct layout parameters.

You need to change your layout items in your RecyclerView to use WRAP_CONTENT.

BrentM
  • 5,671
  • 3
  • 31
  • 38
  • I change my xml however the output is very strange: http://i.stack.imgur.com/2JSOk.png My xml code: http://codepaste.net/82e8z9 My cardview: http://codepaste.net/yzyn5s My activity: http://codepaste.net/bdwxm4 – Aykut Uludağ May 29 '16 at 00:16
  • You need to change the Linear layout that contains the cardview to WRAP_CONTENT instead of MATCH_PARENT – BrentM May 29 '16 at 00:22
  • I changed like that but still same output: http://codepaste.net/91qqsn – Aykut Uludağ May 29 '16 at 00:26
  • 2
    It is each item to be added into the RecyclerView that needs to be WRAP_CONTENT. It is the layout xml file you have with a LinearLayout as the root item that you need to change, not in the activity layout file. – BrentM May 29 '16 at 00:32
  • Finally I changed my xml as below and problem solved. Thank you sir! xml of fragment: http://codepaste.net/zp6sz6 xml of childview: http://codepaste.net/okyph1 – Aykut Uludağ May 29 '16 at 00:39