Recyclerview: Only for the reuse and recycling of the view, the other things to be handled by Viewholder, in the use of XML in the same way as the ListView
--------------------------------------Recyclerview--------------------------------------
-
You must set a layoutmanager for it:
Recycler_view.setlayoutmanager (New Gridlayoutmanager (this, 2));
Recycler_view.setlayoutmanager (New Linearlayoutmanager (this));
Recycler_view.setlayoutmanager (New Staggeredgridlayoutmanager (4, staggeredgridlayoutmanager.vertical));
2. Support Normal ListView GridView, support the setting of the vertical and horizontal direction, and when the item height is set to a random number can be directly into the waterfall stream effect .
Animating effects:
Recycler_view.setitemanimator (New Defaultitemanimator ());
3. Adapter must inherit from recyclerview.adapter
The Notify method for deleting an item is:
notifyitemremoved (position);
--------------------------------------CardView--------------------------------------
1.CardView is a viewgroup, and uses the same layout as the relativelayout.
2. Need to customize a namespace
Android.support.v7.widget.CardView
Xmlns:card= "Http://schemas.android.com/apk/res-auto"
3. Several custom properties are available:
Cardbackgroundcolor
Cardcornerradius
Cardelevation
Android Studio's Recyclerview and CardView first experience