1. 程式人生 > >Android5.0新控制元件CardView的介紹和使用

Android5.0新控制元件CardView的介紹和使用

<resources><declare-styleable name="CardView"><!-- Background color for CardView. --><!-- 背景色 --><attr name="cardBackgroundColor" format="color" /><!-- Corner radius for CardView. --><!-- 邊緣弧度數 --><attr name="cardCornerRadius" format="dimension" /><!--
Elevation for CardView. --><!-- 高度 --><attr name="cardElevation" format="dimension" /><!-- Maximum Elevation for CardView. --><!-- 最大高度 --><attr name="cardMaxElevation" format="dimension" /><!-- Add padding in API v21+ as well to have the same measurements with previous versions.
--><!-- 設定內邊距,v21+的版本和之前的版本仍舊具有一樣的計算方式 --><attr name="cardUseCompatPadding" format="boolean" /><!-- Add padding to CardView on v20 and before to prevent intersections between the Card content and rounded corners. --><!-- 在v20和之前的版本中新增內邊距,這個屬性是為了防止卡片內容和邊角的重疊 --><attr name="cardPreventCornerOverlap"
format="boolean" /><!-- 下面是卡片邊界距離內部的距離--><!-- Inner padding between the edges of the Card and children of the CardView. --><attr name="contentPadding" format="dimension" /><!-- Inner padding between the left edge of the Card and children of the CardView. --><attr name="contentPaddingLeft" format="dimension" /><!-- Inner padding between the right edge of the Card and children of the CardView. --><attr name="contentPaddingRight" format="dimension" /><!-- Inner padding between the top edge of the Card and children of the CardView. --><attr name="contentPaddingTop" format="dimension" /><!-- Inner padding between the bottom edge of the Card and children of the CardView. --><attr name="contentPaddingBottom" format="dimension" /></declare-styleable></resources>