2013-12-10 94 views
0

我试图创建此:如何创建此自定义阴影?

screenshot

的截图显示,看起来像一卡一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" /> 

你怎么会去这样做呢?不知怎的,影子可以包含在可绘制的卡片中吗?

谢谢。

回答

0

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

drop_shadow_dark

或浅色主题:

enter image description here

0

我想9patch将在这里工作精细: enter image description here

+0

Woops 。 @迈克尔打败了我。 – Phix