Primary Use of CardView and primary use of cardview

Source: Internet
Author: User

Primary Use of CardView and primary use of cardview

CardViewReleased in the android sdk v7 support package. For details about how to add a project to the v7 package, refer to the portal here.

Card-based design is an important part of the brand-new Material style design. card-based design is suitable for displaying important information and using it as an item containing complex operations in the list.

CardViewInherited fromFramelayout, RatioFrameLayoutThree more important attributes are added,card_view:cardElevation,card_view:cardCornerRadius,card_view:cardBackgroundColor.

card_view:cardElevation, You can set the card shadow, you can makeCardViewThere is an improved visual effect on the Z axis, which can give users a visual feeling of important information. Corresponding methods in the codepublic void setCardElevation (float radius).

card_view:cardCornerRadiusObviously, it is setCardView. Corresponding methods in the codepublic void setRadius (float radius).

card_view:cardBackgroundColor, SetCardViewThe background color. This attribute does not affect the shadow.card_view:cardElevation. Corresponding methods in the 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/gray" 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 = "here is CardView"/> </android. support. v7.widget. cardView>

Here is a sample officially provided by Android!
-------------
I have been working overtime since November 19 and spent a lot of time on the development of our end-to-end version. During this period, I planned several blog posts that I would like to write and I will release them soon, this article mainly introduces the use of new controls and how to design material styles compatible with versions earlier than lollipop, the material style design will also be a brand new android design in the first quarter of the 15-year project team.

(Reprinted please indicate the source: http://kennethyo.farbox.com/post/android/2014-12-28)

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.