CardView_cardminder是什么软件

CardView_cardminder是什么软件本文介绍CardView这个控件的使用,CardView继承至FrameLayout类,是support-v7包下的一个类,使用时必须引入cardview依赖包,可在下载的sdk文件夹中找到。。。使用CardView可以实现卡片式布局效果,非常好看,卡片还可以包含圆角、阴影、背景。CardView是一个ViewGroup,布局时包含其它的View从而实现优雅界面效果。首先来看看个界面效果:…

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE稳定放心使用

本文介绍CardView这个控件的使用,CardView继承至FrameLayout类,是support-v7包下的一个类,使用时必须引入cardview依赖包,可在下载的sdk文件夹中找到。。。

使用CardView可以实现卡片式布局效果,非常好看,卡片还可以包含圆角、阴影、背景。CardView是一个ViewGroup,布局时包含其它的View从而实现优雅界面效果。

首先来看看个界面效果:
在这里插入图片描述
是不是很漂亮啊!其实使用起来很简单,把它作为一个普通的Layout使用即可。如下:

 <android.support.v7.widget.CardView
        android:id="@+id/card_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        app:cardBackgroundColor="#ffffff"
        app:cardCornerRadius="10dp"
        app:cardElevation="8dp">
        <TextView
            android:id="@+id/text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="40dp"
            android:text="CardView"
            android:textSize="20sp" />
    </android.support.v7.widget.CardView>

整个布局activity_main.xml:

<LinearLayout 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:orientation="vertical"
    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=".MainActivity">
 
    <android.support.v7.widget.CardView
        android:id="@+id/card_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        app:cardBackgroundColor="#ffffff"
        app:cardCornerRadius="10dp"
        app:cardElevation="8dp">
        <TextView
            android:id="@+id/text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="40dp"
            android:text="CardView"
            android:textSize="20sp" />
    </android.support.v7.widget.CardView>
 
    <android.support.v7.widget.CardView
        android:id="@+id/card_view2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        app:cardBackgroundColor="#303069"
        app:cardCornerRadius="10dp"
        app:cardElevation="8dp">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_margin="40dp"
            android:text="CardView"
            android:textSize="20sp" />
    </android.support.v7.widget.CardView>
 
    <android.support.v7.widget.CardView
        android:id="@+id/card_view3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        app:cardBackgroundColor="#ffffff"
        app:cardCornerRadius="8dp"
        app:cardElevation="5dp">
        <ImageView
            android:id="@+id/imageView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scaleType="fitXY"
            android:src="@mipmap/bg" />
    </android.support.v7.widget.CardView>
 
</LinearLayout>

常用属性:
app:cardElevation 阴影的高度
app:cardMaxElevation 阴影最大高度
app:cardBackgroundColor 卡片的背景色
app:cardCornerRadius 卡片的圆角大小
app:contentPadding 卡片内容于边距的间隔
app:contentPaddingBottom
app:contentPaddingTop
app:contentPaddingLeft
app:contentPaddingRight
app:contentPaddingStart
app:contentPaddingEnd
app:cardUseCompatPadding 设置内边距
app:cardPreventConrerOverlap 这个属性为了防止内容和边角的重叠

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/183027.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • SqlTransaction事务的用法

    SqlTransaction事务的用法使用SqlTransaction实现数据库操作事务 SqlTransaction类是对SQLServer数据库进行事务处理的类,该类的实例由SqlConnection类实例的BeginTransaction方法创建,表示在该数据库连接实例上开始一个数据库事务,创建SqlTransaction类实例后,在程序中使用该实例的Commit方法提交事务,或者使用该类的Rollback方法回滚事…

    2022年6月10日
    28
  • 微信模拟位置想在哪就在哪(GPS欺骗)

    微信模拟位置想在哪就在哪(GPS欺骗)微信模拟位置是通过位置欺骗,让微信误以为我们就在当前的位置进行周边好友的搜索与添加。这是一个很老的功能,为什么说很老呢?因为这是在android4.1的时候流行的一个功能,android在4.4推出后这个功能基本不能使用了!即使很老但是最近也碰到了这样的需求,不过针对特殊的群体,手机定制而来,就没有限制了!首先我们要知道怎么用:首先:我们从设置里找到开发者选项(开发者都知道):在这里就是,开发人

    2022年4月30日
    54
  • JSONObject和JSONArray的转换[通俗易懂]

    JSONObject和JSONArray的转换[通俗易懂]转换的时候原本写的是 两个类都写的是:JSONArray jsonArray =(JSONArray)jsonObject.get(“List”);结果一个转换没错,另一个后台报错java.util.ArrayListcannotbecasetocom.alibaba.fastjson.JSONArray 转换成JSONArrayjsonArr

    2022年5月2日
    44
  • DHT11湿度传感器开发「建议收藏」

    DHT11湿度传感器开发「建议收藏」本文对在CC2540上开发DHT11湿度传感器进行裸机开发,并显示与LED屏上,如下图所示看了无数的datasheet,终于看到中文的了,感觉一下轻松很多,虽然这颗传感器科技含量也不是特别高,但精神还是为之一振,希望我朝设计出更高端的电子元器件。湿敏元件是最简单的湿度传感器。湿敏元件主要有电阻式、电容式两大类。湿敏电阻的特点是在基片上覆盖一层用感湿材料制成的膜,当空气中

    2022年9月29日
    4
  • pychram2021 激活码_在线激活

    (pychram2021 激活码)最近有小伙伴私信我,问我这边有没有免费的intellijIdea的激活码,然后我将全栈君台教程分享给他了。激活成功之后他一直表示感谢,哈哈~IntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,下面是详细链接哦~https://javaforall.net/100143.html1S…

    2022年3月27日
    50
  • log4j 格式_标题的含义和作用ppt

    log4j 格式_标题的含义和作用ppt2019独角兽企业重金招聘Python工程师标准>>>…

    2022年8月22日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号