[英]How to make a drop shadow on a custom shape
我有形状
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item >
<shape android:shape="rectangle" >
<solid android:color="@color/white"/>
<corners android:radius="15dip" />
<stroke android:width="1dip" android:color="@color/shadow" />
</shape>
</item>
</selector>
但是我的问题是阴影,有没有办法做到这一点?
使用CardView在Android中创建阴影视图
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@android:color/white"
android:foreground="?android:attr/selectableItemBackground"
card_view:cardElevation="3dp"
card_view:cardCornerRadius="4dp">
card_view:cardElevation="3dp"
这是阴影 card_view:cardCornerRadius="4dp"
这是拐角半径
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.