0

シンプルなxml-layoutがあります:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:gravity="center"
    android:padding="5dp" >

    <Button
        android:padding="15dp"
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:shadowColor="@android:color/black"
        android:shadowDy="10"
        android:shadowRadius="5"
        android:text="Button" />
 </LinearLayout>

これをアクティビティのコンテンツ ビューとして設定すると、ボタンのテキストの下に黒い影が表示されます。しかし、変更android:shadowColor="@android:color/black"するとandroid:shadowColor="@android:color/white"、影がなくなります。なんで?

4

1 に答える 1

0

自分でこれに遭遇しました。私にとっては、背景が明るいときに発生し、明るい背景に白い影が混ざることは目立ちませんでした. Android:shadowRadius を小さく (0.1) に変更したところ、問題は解決しました。

于 2012-10-11T08:03:12.497 に答える