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


相关推荐

  • 伽马校正算法_伽马设定

    伽马校正算法_伽马设定写在前面我相信几乎所有做图像处理方面的人都听过伽马校正(GammaCorrection)这一个名词,但真正明白它是什么、为什么要有它、以及怎么用它的人其实不多。我也不例外。最初我查过一些资料,但很多文章的说法都不一样,有些很晦涩难懂。直到我最近在看《RealTimeRendering,3rdEdition》这本书的时候,才开始慢慢对它有所理解。本人才疏学浅,写的这篇文章很

    2022年9月25日
    3
  • psm倾向得分匹配法举例_【计量地图】倾向得分匹配法(PSM)理论、操作与案例…[通俗易懂]

    这个方法的难点在于:首先,要明白反事实框架是一个什么样的东西?为什么一般把参与项目和不参与项目进行对比时会出现选择偏误?其次,搞清楚上面的原理之后,PSM真正难的是找到合适的协变量和完成两个苛刻的检验(共同支撑检验和平衡性检验)这篇文章我想达到哪些学习目标:(1)尽量汇集我看过的有用的资料(2)展示一个PSM分析的理论框架(3)针对难点说一下模型的调整问题(协变量选择、两个检验的调整)主要框架:1…

    2022年4月12日
    247
  • javascript 替换有害字符(学习一下prototype与javascript正则)

    javascript 替换有害字符(学习一下prototype与javascript正则)

    2021年7月31日
    53
  • Linux文件的rwx含义,文件(目录)rwx权限的意义[通俗易懂]

    Linux文件的rwx含义,文件(目录)rwx权限的意义[通俗易懂]我们知道不同的角色针对同一个文件(目录)可能会有不同的权限,那么rwx权限的意义是什么呢?对于文件文件是包含实际数据的地方,包括一般文本文件、数据库内容文件、二进制可执行文件等。对于文件来说,rwx权限的意义为:r:read,可读取此文件的内容,即可以打开文件;w:write,可编辑此文件的内容,如可以增加、删除、更改文件内容;x:execute,可以执行此文件。需要注意的是,文件的权限rwx都是…

    2022年5月20日
    88
  • scipy安装失败

    scipy安装失败pipinstallscipy安装失败可以从uci网站下载wheel安装包然后执行pipinstallxx.whl进行安装http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy转载于:https://www.cnblogs.com/timlong/p/6068370.html…

    2025年5月31日
    3
  • C++基础语法

    C++基础语法基础语法第一个程序#include<iostream>usingnamespacestd;intmain(){cout<<"H

    2021年12月13日
    52

发表回复

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

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