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)
上一篇 2022年10月11日 下午9:16
下一篇 2022年10月11日 下午9:16


相关推荐

  • css设置当字数超过限制后以省略号(…)显示

    css设置当字数超过限制后以省略号(…)显示

    2022年3月8日
    266
  • 我扫描了1000+个提示词,省去你们的麻烦:10个你需要知道的技巧

    我扫描了1000+个提示词,省去你们的麻烦:10个你需要知道的技巧

    2026年3月14日
    1
  • linux tty_linux tty

    linux tty_linux ttyLinux中的tty与pts终端是一种字符型设备,它有多种类型,通常使用tty来简称各种类型的终端设备。tty是Teletype的缩写。 Teletype是最早出现的一种终端设备——可以称作电传打字机,由Teletype公司生产。tty在Linux系统的设备特殊文件目录/dev/下。终端特殊设备文件一般有以下几种:1、串行端口终端(/dev/ttySn)串行端口终端(Serial Port Terminal)是使用计算机串行端口连接的终端设备。计算机把每个串行端口都看作是一个字符设备。有段时间这

    2022年8月9日
    9
  • nat模式「建议收藏」

    nat模式「建议收藏」原文链接:https://www.linuxidc.com/Linux/2016-09/135521p2.htm(复制过来只是为了学习方便,如有不妥会立即删除)二、NAT(地址转换模式)刚刚我们说到,如果你的网络ip资源紧缺,但是你又希望你的虚拟机能够联网,这时候NAT模式是最好的选择。NAT模式借助虚拟NAT设备和虚拟DHCP服务器,使得虚拟机可以联网。其网络结构如下图所示:在NAT模式中,主机…

    2022年6月29日
    23
  • 哈夫曼树(C语言实现)

    哈夫曼树(C语言实现)文章目录哈夫曼树的基本概念哈夫曼树的构建构建思路代码实现哈夫曼编码的生成编码生成思路代码实现完整代码展示以及代码测试哈夫曼树的基本概念在认识哈夫曼树之前 你必须知道以下几个基本术语 1 什么是路径 给定 N 个权值作为 N 个结点 构造一棵二叉树 若该树的带权路径长度达到最小 则称该二叉树为哈夫曼树 也被称为最优二叉树 哈夫曼树的构建构建思路代码实现哈夫曼编码的生成编码生成思路代码实现完整代码展示以及代码测试

    2026年3月19日
    3
  • eclipse中android开发_Android开发教程

    eclipse中android开发_Android开发教程创建第一个Android项目本系列文章主要针对基于Eclipse的IDE下进行Android开发的技术、方法、过程与技巧进行记录。本文将记录,以Win1064位操作系统为例,使用Eclipse创建第一个Android项目,并配置运行的过程。该过程包括:创建Android工程和在Android虚拟设备上运行程序。创建Android工程1)启动Eclipse

    2022年10月4日
    4

发表回复

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

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