Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/225.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何创建此自定义阴影?_Android_Android Layout - Fatal编程技术网

Android 如何创建此自定义阴影?

Android 如何创建此自定义阴影?,android,android-layout,Android,Android Layout,我正在尝试创建以下内容: 屏幕截图显示了一个看起来像卡片的UI元素,它下面有一个弯曲的阴影。我不确定创建阴影的最佳方法是什么。如果有人已经实现了类似的东西,您的洞察力将不胜感激 以下是初步布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/wrapper" android:layout_width="match_parent" android:lay

我正在尝试创建以下内容:

屏幕截图显示了一个看起来像卡片的UI元素,它下面有一个弯曲的阴影。我不确定创建阴影的最佳方法是什么。如果有人已经实现了类似的东西,您的洞察力将不胜感激

以下是初步布局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/wrapper"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<RelativeLayout
    android:id="@+id/card"
    style="@style/card"> <!-- contains the card drawable -->

    <TextView
        android:text="Text and images go here" />

</RelativeLayout>   

<ImageView 
    android:background="card_shadow" />

你打算怎么做?阴影是否可以包含在可提取的卡片中


谢谢。

我使用的RelativeLayout包含带填充的RelativeLayout。内部布局包含实际视图和以下背景:

或针对轻主题:


我认为9补丁在这里可以正常工作:

Woops@迈克尔在那里打败了我。