CardView is a component that is placed in the Support Library V7 package (Recyclerview is also here, which is explained in detail in the blog behind)
At the beginning of writing Recyclerview's demo, found that others are written out of the card-type layout, very good-looking oh ~ and I wrote or the original ListView a style, checked for half a day, finally found in the layout of the article appeared different, This also involves the use of CardView.
<span style= "FONT-SIZE:14PX;" ><android.support.v7.widget.cardview xmlns:android= "Http://schemas.android.com/apk/res/android" Xmlns:card _view= "Http://schemas.android.com/apk/res-auto" android:layout_width= "Match_parent" android:layout_height= "match _parent "android:layout_margin=" 5DP "card_view:cardbackgroundcolor=" @color/cardview_dark_background "Card_v iew:cardcornerradius= "5DP" > <relativelayout android:layout_width= "match_parent" Android:la yout_height= "100DP" android:padding= "5DP" > <imageview android:id= "@+id/pic" Android:layout_width= "Match_parent" android:layout_height= "Match_parent" Android:layout_c Enterinparent= "true" android:scaletype= "Centercrop"/> <textview Android:clicka Ble= "true" android:id= "@+id/name" android:layout_width= "Match_parent" Android:layout_height= "Match_parent" android:layout_marginbottom= "10DP" android:layout_marginright= "10DP" Android:gravity= "Right|bottom" android:textcolor= "@android: Color/white" Android:tex Tsize= "24sp"/> </RelativeLayout> </android.support.v7.widget.CardView> </span>
probably see, it also uses the CardView control to wrap the original item layout, the width is still used to fill the parent form
Layout_margin represents the interval between cards, which should be half the real interval (reason you should understand)
Cardcornerradius indicates the arc of the peripheral fillet of the card
Cardbackgroundcolor indicates the card background color
The latter two properties belong to the Card_view namespace, so don't forget to add the named control when you use it
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Use of the Android Card view component CardView