android cardview

来源:互联网 发布:光纤三端口环形器原理 编辑:程序博客网 时间:2024/05/24 04:32
public class CardView extends FrameLayout implements CardViewDelegate

添加 的特殊属性

 * @attr ref android.support.v7.cardview.R.styleable#CardView_cardBackgroundColor * @attr ref android.support.v7.cardview.R.styleable#CardView_cardCornerRadius * @attr ref android.support.v7.cardview.R.styleable#CardView_cardElevation * @attr ref android.support.v7.cardview.R.styleable#CardView_cardMaxElevation * @attr ref android.support.v7.cardview.R.styleable#CardView_cardUseCompatPadding * @attr ref android.support.v7.cardview.R.styleable#CardView_cardPreventCornerOverlap * @attr ref android.support.v7.cardview.R.styleable#CardView_contentPadding * @attr ref android.support.v7.cardview.R.styleable#CardView_contentPaddingLeft * @attr ref android.support.v7.cardview.R.styleable#CardView_contentPaddingTop * @attr ref android.support.v7.cardview.R.styleable#CardView_contentPaddingRight * @attr ref android.support.v7.cardview.R.styleable#CardView_contentPaddingBottom
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:app="http://schemas.android.com/apk/res-auto"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:paddingBottom="@dimen/activity_vertical_margin"    android:paddingLeft="@dimen/activity_horizontal_margin"    android:paddingRight="@dimen/activity_horizontal_margin"    android:paddingTop="@dimen/activity_vertical_margin"    tools:context="com.andyidea.guidedemo.RecycleViewActivity">    <android.support.v7.widget.CardView        android:layout_width="match_parent"        android:layout_height="match_parent"        android:contextClickable="false"        android:elevation="5dp"        android:focusable="true"        app:contentPadding="10dp"        app:cardCornerRadius="8dp">        <android.support.v7.widget.RecyclerView            android:id="@+id/rv"            android:layout_width="match_parent"            android:layout_height="match_parent"            android:elevation="10dp"></android.support.v7.widget.RecyclerView>    </android.support.v7.widget.CardView></RelativeLayout>

使用特殊属性
app:contentPadding=”10dp”
app:cardCornerRadius=”8dp”

0 0
原创粉丝点击