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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • adb命令大全介绍

    adb命令大全介绍adb是什么adb的全称为AndroidDebugBridge,就是起到调试桥的作用。它就是一个命令行窗口,用于通过电脑端与模拟器或者是设备之间的交互。adb有什么用借助adb工具,我们可以

    2022年6月30日
    27
  • 图片加载失败后显示默认图片

    图片加载失败后显示默认图片加载失败后显示默认图:<img:src=”`${img}.png`”onerror=”javascript:this.src=’logo.png'”/>也可以在图片加载失败后弹出提示:<imgsrc=”image.gif”onerror=”alert(‘图片不能被加载。’)”>扩展小知:img除了支持加载失败的回调,也支持加载中断及加载成功的回调。用法:onabort:<imgsrc=”image_w3default.gif”onabort

    2022年5月28日
    35
  • 四大审计费收费标准_四大 税务咨询收费

    四大审计费收费标准_四大 税务咨询收费“7年的心血和积累,说关就要关,说停就要停。没有人会甘心,但也早料到这一刻会突然到来。现在所能做的,唯有面对现实,准备好勇气,即使全部推倒从头再来,我们也绝不放弃。”1月22日,国内著名资源分享网站VeryCD的创始人黄一孟的这样一条微博牵动了不少用户的神经。用户们发现,VeryCD网站上的音乐频道已经悄然关闭,电影和电视剧频道也不再提供下载链接。坊间则风传VeryCD未取得广电总局的视听服务许

    2022年8月10日
    16
  • H5文件简介和使用

    H5文件简介和使用H5文件是层次数据格式第5代的版本(HierarchicalDataFormat,HDF5),它是用于存储科学数据的一种文件格式和库文件。接触到这个文件格式也是因为上Coursera深度学习课程的时候,作业用到了。它是由美国超级计算与应用中心研发的文件格式,用以存储和组织大规模数据。目前由非营利组织HDF小组提供支持。目前,很多商业和非商业组织都支持这种文件格式,如Java,MATLAB,P…

    2025年10月13日
    3
  • 分布式存储Tair

    分布式存储TairTairtair 是淘宝在 2010 年开源的分布式 k v 缓存 存储系统 主要支持以下四种引擎 mdb 类似 memcahe rdb 采用 redis 中的存储结构 支持 k v list hash set 等 ldb leveldb kdb KyotoCabinet 可以让我们更方便的使用这些 kv 数据库 其中 mdb rdb 是分布式缓存 ldb kdb 是分布式存储 tair 支持 version 每个数据中包含一个 version 信息 可以保证数据都是基于最新的数据进行更新 比如有数据

    2025年10月27日
    4
  • 蚂蚁矿机linux系统文件,蚂蚁显卡矿机G2系统一键还原教程[通俗易懂]

    蚂蚁矿机linux系统文件,蚂蚁显卡矿机G2系统一键还原教程[通俗易懂]一、还原准备工作[ol]一台办公电脑(建议win7或以上系统,配置不限)一个可以格式化的U盘(最少8G,速度不限)下载UltraISO刻录软件《uiso9_cn.exe》至桌面下载《clonezilla-live-2117-11-29-03-img.iso》文件至桌面下载《checksum64.exe》至桌面双击打开checksum64.exe,把下载下来的ISO文件移动至软件中,点击选项-&gt…

    2022年9月28日
    3

发表回复

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

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