Android 5.0 new features Learn--cardview

Source: Internet
Author: User

CardView inherits from the Framelayout class, which allows for consistent display of content in a card layout that can contain fillets and shadows. CardView is a layout that can be used to lay out other view.

Properties of the CardView:

Elevation--cardview z-axis shadows;

Cardbackgroundcolor--cardview color of Cards;

Cardconerradius--The degree of rectangle of the four corners of the CardView card;

In the following XML file, this card control is a card that has a rectangle degree of 8DP and a black background color.

<Android.support.v7.widget.CardViewxmlns:android= "Http://schemas.android.com/apk/res/android"Xmlns:app= "Http://schemas.android.com/apk/res-auto"Android:id= "@+id/cardview"App:cardcornerradius= "8DP"App:cardbackgroundcolor= "@color/black"Android:layout_margin= "8DP"Android:layout_height= "80DP"Android:layout_width= "Match_parent">        <TextViewAndroid:text= "TextView in CardView"android:layout_gravity= "Center"android:textsize= "26SP"Android:textcolor= "@color/l_white"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content" />  </Android.support.v7.widget.CardView>  

Android 5.0 new features learn--cardview

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.