当前位置: 首页 > news >正文

网站建设公司哪家专业厦门百度代理

网站建设公司哪家专业,厦门百度代理,搭建网站流程视频,网站如何做秒杀活动在 Android 开发中&#xff0c;CardView 的阴影效果会受到父容器的裁切&#xff08;见上图&#xff09;&#xff0c;此问题下的父容器可以分为两种 无 padding 的父容器 <LinearLayoutandroid:layout_width"wrap_content"android:layout_height"wrap_conte…
  • 在 Android 开发中,CardView 的阴影效果会受到父容器的裁切(见上图),此问题下的父容器可以分为两种
  1. 无 padding 的父容器
<LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"><androidx.cardview.widget.CardViewandroid:layout_width="492px"android:layout_height="420px"app:cardCornerRadius="10px"app:cardElevation="8px"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical" /></androidx.cardview.widget.CardView>
</LinearLayout>
  1. 有 padding 的父容器
<LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:padding="20px"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"><androidx.cardview.widget.CardViewandroid:layout_width="492px"android:layout_height="420px"app:cardCornerRadius="10px"app:cardElevation="8px"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical" /></androidx.cardview.widget.CardView>
</LinearLayout>
处理策略
(1)针对无 padding 的父容器
  1. 禁用裁切,给祖父容器添加 android:clipChildren="false"
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"android:layout_width="match_parent"android:layout_height="match_parent"android:clipChildren="false"tools:context=".ViewShadowActivity"><LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"><androidx.cardview.widget.CardViewandroid:layout_width="492px"android:layout_height="420px"app:cardCornerRadius="10px"app:cardElevation="8px"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical" /></androidx.cardview.widget.CardView></LinearLayout></androidx.constraintlayout.widget.ConstraintLayout>
  1. 添加 CardView 的外边距,给 CardView 添加 android:layout_margin
<LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"><androidx.cardview.widget.CardViewandroid:layout_width="492px"android:layout_height="420px"android:layout_margin="20px"app:cardCornerRadius="10px"app:cardElevation="8px"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical" /></androidx.cardview.widget.CardView>
</LinearLayout>
  1. 启用 CardView 的兼容模式,给 CardView 添加 app:cardUseCompatPadding="true"
<LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"><androidx.cardview.widget.CardViewandroid:layout_width="492px"android:layout_height="420px"app:cardUseCompatPadding="true"app:cardCornerRadius="10px"app:cardElevation="8px"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical" /></androidx.cardview.widget.CardView>
</LinearLayout>
(2)针对有 padding 的父容器
  • 给父容器添加 android:clipToPadding="false"
<LinearLayoutandroid:layout_width="wrap_content"android:layout_height="wrap_content"android:clipToPadding="false"android:padding="20px"app:layout_constraintBottom_toBottomOf="parent"app:layout_constraintEnd_toEndOf="parent"app:layout_constraintStart_toStartOf="parent"app:layout_constraintTop_toTopOf="parent"><androidx.cardview.widget.CardViewandroid:layout_width="492px"android:layout_height="420px"app:cardCornerRadius="10px"app:cardElevation="8px"><LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical" /></androidx.cardview.widget.CardView>
</LinearLayout>
http://www.shuangfujiaoyu.com/news/48813.html

相关文章:

  • 手机建站永久免费软件广州seo网站开发
  • 广东省住房与城乡建设厅网站推广产品引流的最佳方法
  • 网站忧化靠谱seo淘宝优化标题都是用什么软件
  • 网站框架地图百度快速排名用是
  • 怎么做五合一网站新闻类软文营销案例
  • 网站运维工作内容市场调研报告的基本框架
  • 网站怎么做速排推广普通话演讲稿
  • 网站建设规划表简述seo和sem的区别与联系
  • wordpress建站的利弊怎样做百度推广
  • 国外做化工产品的网站长沙seo公司排名
  • 北京建网站找哪个公司中国今天最新军事新闻
  • 自适应网站平台沧州网络推广外包公司
  • 做设计必知网站网站seo排名优化工具在线
  • 电子商务烟台网站建设腾讯疫情实时数据
  • 360网站seo如何做厦门关键词排名优化
  • 专业网站建设搭建2023年6月份疫情严重吗
  • 外贸开源网站建站流程主要有哪些
  • 免费域名申请网站空间最新新闻事件今天疫情
  • 百度做网站吗网站seo推广公司靠谱吗
  • 做外贸生意哪个网站好未来网络营销的发展趋势
  • 北美购物网站排名网站设计制作的服务怎么样
  • 一级a做爰片就在线手机看韩国网站seo综合查询站长工具关键词
  • 免费空间自助建站模板网站怎么优化推广
  • 用别人网站做app的危害seo网站推广工具
  • 运维兼职平台南京seo代理
  • 工业设计和产品设计的区别网站建设推广优化
  • 淄川政府网站建设公司产品营销策略有哪些
  • 做药物分析网站百度大数据分析
  • 帮人注册网站 做appgoogle官网进入
  • 导航网站怎么做seosemester是什么意思