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


相关推荐

  • spring整合log4j_log4j和logback同时使用

    spring整合log4j_log4j和logback同时使用常用日志框架log4j、log4j2(log4j的升级版,最常用的)、logback(spring boot默认)、Jboss-logging…等slf4 是日志接口规范,代码对接slf4,实现和具体日志框架解耦,无需修改编码即可切换日志框架。修改pom依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-st

    2022年8月8日
    5
  • 更新python3.6可能使用的依赖

    更新python3.6可能使用的依赖

    2022年3月12日
    41
  • BP神经网络预测(人口)程序(matlab)

    BP神经网络预测(人口)程序(matlab)自己测试人口预测的matlab实现:x=[54167  55196  56300  57482  58796  60266  61465  62828  64653  65994  67207  66207  65859  67295  69172  70499  72538  74542…

    2022年9月5日
    6
  • 分布式爬虫架构_分布式爬虫工具有哪些

    分布式爬虫架构_分布式爬虫工具有哪些目录分布式爬虫框架消息队列Redis和Scrapy-Redis分布式爬虫框架分布式爬虫框架分为两种:控制模式(左)和自由模式(右):控制模式中的控制节点是系统实现中的瓶颈,自由模式则面临爬行节点之间的通信处理问题。因此,在实际工程中,我们通常使用混合模式:各个爬行节点有各自的功能(爬取的对象不同),它们都注册到一个服务节点上,服务节点能分辨各个爬行节点的分工,用户的请求存放在队列中,处理不同请求的程序从队列中取出请求,然后询问服务节点,由服务节点分配爬行节点给请求的处理程序。下面介绍分布式爬

    2022年10月29日
    0
  • 【Android Tricks 6】ViewPager首页与尾页的滑动动作响应[通俗易懂]

    【Android Tricks 6】ViewPager首页与尾页的滑动动作响应

    2022年1月28日
    40
  • python输出unicode编码_Python以utf8编码读取文件

    python输出unicode编码_Python以utf8编码读取文件withopen(self.path,’r’)astest:forlineintest:pass代码如上,出现错误:UnicodeDecodeError:’gbk’codeccan’tdecodebyte0x80inposition…UnicodeDecodeError:’gbk’codeccan’tdecodebyte0x80inposition9:…或者是UnicodeDecodeErr..

    2022年9月13日
    0

发表回复

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

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