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.

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 fromFramelayoutThanFrameLayout3 more important attributes,card_view:cardElevationcard_view:cardCornerRadiuscard_view:cardBackgroundColor

card_view:cardelevation , you can set the shadow of the card, you can make cardview has an uplifting visual effect on the z axis, giving the user a visual sense of important information here. Corresponding code in the method public void setcardelevation (float radius) .

card_view:cardcornerradius , is clearly set cardview the rounded corners of the . Corresponding code in the method public void Setradius (float radius) .

card_view:cardBackgroundColorSet upCardViewThe background color, this property is not affected by the shadowcard_view:cardElevationEffect of the. The method in the corresponding codepublic 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">                <textview                android:layout_width="Wrap_content"                android:layout_height="Wrap_content"                android:layout_margin="@dimen/margin"                android:text="This is CardView."                /></android.support.v7.widget.CardView>

Here is an Android official to the sample bar!
—————————————
Since November 19 has been working overtime, to spend a lot of time on the development of our end-of-the-year version, this period planning a few want to write the blog, slowly will be issued, mainly to introduce the use of new controls, and how to compatible with lollipop the following version of material style design, Material style design will also be my project team in the first quarter of 15 Android new design.

(Reproduced Please specify Source: http://kennethyo.farbox.com/post/android/2014-12-28)

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.