android--CardView Primary Use

Source: Internet
Author: User

CardViewIn the support package for Android SDK V7, specifically how to add a project to the V7 package, see the portal here.

android–5.0 Lollipop

Cards are one of the most important components of the new material style design , and the card design is suitable for the presentation of important information, as well as the use of the list as an item containing complex operations.

CardViewInherit Framelayout , more than FrameLayout 3 important attributes,, card_view:cardElevation card_view:cardCornerRadius card_view:cardBackgroundColor .

    • card_view:cardElevation, you can set the shadow of the card so that CardView there is a visual effect of lifting in the z-axis direction public void setCardElevation (float radius) .
    • card_view:cardCornerRadius, it is clearly CardView the rounded corners that are set. The method in the corresponding code public void setRadius (float radius) .
    • card_view:cardBackgroundColor, set CardView the background color , this property will not affect the card_view:cardElevation effect of the shadow. public void setCardBackgroundColor (int color).

 

<Android.support.v7.widget.CardViewAndroid:id= "@+id/cardview"Android:layout_width= "Fill_parent"Android:layout_height= "Wrap_content"card_view:cardelevation= "100DP"Card_view:cardbackgroundcolor= "@color/grey"Card_view:cardcornerradius= "8DP"Android:layout_marginleft= "@dimen/margin"Android:layout_marginright= "@dimen/margin">                <TextViewAndroid:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:layout_margin= "@dimen/margin"Android:text= "This is CardView"                /></Android.support.v7.widget.CardView>

android--CardView Primary Use

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.