CardView

CardView是在安卓5.0提出的卡片式控件。
dependencies:

 compile 'com.android.support:cardview-v7:23.4.0'

基本属性:
app:cardBackgroundColor 设置背景颜色
app:cardCornerRadius 设置圆角大小
app:cardElevation 设置z轴的阴影
app:cardMaxElevation 设置z轴的最大高度值
app:cardUseCompatPadding 是否使用CompatPadding
app:cardPreventCornerOverlap 是否使用PreventCornerOverlap
app:contentPadding 设置内容的

CardView继承自FrameLayout,是一个容器。用于显示卡片样式的内容。很漂亮。


    <android.support.v7.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginBottom="5dp"
        android:layout_marginTop="5dp"
        >
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="10dp">    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="10dp">
            //这里是主内容


        </RelativeLayout>
    </android.support.v7.widget.CardView>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值