Android ImageView 在触摸时不可见

Android ImageView invisible while touching

我有一个带有 ImageView 作为叠加层的按钮。 ImageView 不可点击,所以我仍然可以使用按钮。奇怪的是,当我触摸按钮时不可点击的 ImageView 变得不可见,当我释放它时再次出现。

<RelativeLayout
    android:id="@+id/buttonMailLayout"
    android:layout_width="208dp"
    android:layout_height="160dp"
    android:layout_centerHorizontal="true">

    <Button
        android:id="@+id/buttonMail"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/metal"
        android:text="Write Mail"
        android:textSize="32dp"
        android:gravity="bottom|center_horizontal"
        android:paddingBottom="16dp"/>

    <ImageView
        android:id="@+id/imageMail"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@drawable/email20"
        android:elevation="2dp"
        android:paddingTop="8dp"
        android:paddingBottom="64dp"
        android:clickable="false"/>

</RelativeLayout>

这是我使用的代码:

Button buttonMail = (Button) this.findViewById(R.id.buttonMail);

buttonMail.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View arg0) {
            Toast.makeText(getApplicationContext(), "New Mail to : " + p._email,
                    Toast.LENGTH_SHORT).show();
        }
    });

知道出了什么问题吗?会不会跟海拔有关系?我必须在 5.1 上向我的 ImageView 添加 2dp 高度才能使其位于按钮前面。

我认为是 5.0 及更高版本中的按钮默认提升行为导致了此问题,请尝试以这种方式将按钮放置在单独的布局中,它应该可以工作:

<RelativeLayout
android:id="@+id/buttonMailLayout"
android:layout_width="208dp"
android:layout_height="160dp"
android:layout_centerHorizontal="true">

<FrameLayout    
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="bottom|center_horizontal"
>
    <Button
        android:id="@+id/buttonMail"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/metal"
        android:text="Write Mail"
        android:textSize="32dp"         
        android:paddingBottom="16dp"/>
</FrameLayout>  
<ImageView
    android:id="@+id/imageMail"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:src="@drawable/email20"
    android:elevation="2dp"
    android:paddingTop="8dp"
    android:paddingBottom="64dp"
    android:clickable="false"/>

</RelativeLayout>