Recycler view item fill up entire recycler view height after upgrading support library from “23.1.1” to “23.2.1”

后端 未结 7 2272
天命终不由人
天命终不由人 2020-12-24 06:28

Previously, I\'m using the following old support libraries \"23.1.1\".

compile \'com.android.support:appcompat-v7:23.1.1\'
compile \'com.android.support:supp         


        
7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-24 06:45

    I had a similar problem. It endend up being that the recycler was not the problem. Check that your CardView item measurements translate to something like this:

    
    

    If you're not using CardView, ensure that the element you use in your Adapter for the view has android:layout_height="wrap_content" and not match_parent.

    If that fails to work, you can add another attribute setting the minHeight or maxHeight for the view item.

提交回复
热议问题