回答

0

BASIC

CardView比ImageView的高海拔。因此,只需爲ImageView設置較高的 高程。

在這裏,我們去..

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:paddingBottom="@dimen/activity_vertical_margin" 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
    android:paddingRight="@dimen/activity_horizontal_margin" 
    android:paddingTop="@dimen/activity_vertical_margin" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    tools:context=".activity.Splash" 
    tools:showIn="@layout/activity_splash" 
    > 


    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

    <android.support.v7.widget.CardView 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:cardUseCompatPadding="true" 
     android:elevation="5dp" 
     android:stateListAnimator="@anim/button_elevation" 
     android:id="@+id/one" 
     android:layout_marginLeft="@dimen/activity_horizontal_margin" 
     > 

     <RelativeLayout 
      android:orientation="vertical" android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:padding="@dimen/activity_horizontal_margin" 
      android:background="?attr/selectableItemBackground" 

      > 

      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:text="this is just for test" 
       /> 

      </RelativeLayout> 
    </android.support.v7.widget.CardView> 


     <ImageView 
      android:layout_marginRight="@dimen/activity_horizontal_margin" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/cross" 
      android:id="@+id/two" 
      android:layout_centerVertical="true" 
      android:elevation="10dp" 
      /> 

</RelativeLayout> 
</RelativeLayout> 

而且屏幕截圖....

enter image description here

+0

不錯的嘗試,但從最後的形象刪除海拔比這不起作用 - @AndroidHacker –

+0

解決方案沒有爲你工作...非常奇怪。 – AndroidHacker