将右下角的图像视图放在 CardView 中

Place bottom right imageview in CardView

我无法移动右下角的 ImageView。我尝试使用相对布局,但图像不可见(卡片下的图像。)

Android API 21、使用默认样式。

How it see in emulator.

        >

    <ImageView
            android:layout_width="120dp"
            android:layout_height="120dp"
            android:id="@+id/imageView"
            android:layout_alignParentStart="true"
            android:layout_alignParentLeft="true"
            android:scaleType="fitCenter" android:src="@drawable/notfoundmusic" android:background="#00ffffff"
            android:padding="8dp" android:contentDescription="@string/notfoundimage"/>

    <TextView
            android:id="@+id/head_author"
            android:layout_width="match_parent"
            android:textAppearance="?android:attr/textAppearanceLarge"
            android:layout_height="match_parent"
            android:text="Tove Lo"
            android:paddingLeft="120dp"
            android:maxLines="1" android:textColor="#000000"
            android:textSize="20sp" android:paddingTop="6dp"/>

    <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="?android:attr/textAppearanceSmall"
            android:text="Шведская певица и автор песен. Она привлекла к себе внимание в 2013 году с выпуском сингла «Habits», но настоящего успеха добилась с ремиксом хип-хоп продюсера Hippie Sabotage на эту песню, который получил название «Stay High». 4 марта 2014 года вышел её дебютный мини-альбом Truth Serum, а 24 сентября этого же года дебютный студийный альбом Queen of the Clouds. Туве Лу является автором песен таких артистов, как Icona Pop, Girls Aloud и Шер Ллойд."
            android:id="@+id/description" android:layout_alignParentTop="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true" android:layout_marginLeft="120dp"
            android:layout_marginStart="120dp"
            android:layout_marginTop="30dp" android:textSize="15dp" android:maxLines="3"/>
    <ImageView
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:id="@+id/imageView2" android:layout_alignParentBottom="true"
            android:layout_alignParentEnd="true" android:src="@drawable/genres_opera"
    />
</android.support.v7.widget.CardView>

我用过RelativeLayout。在我使用的应该在后台的项目上:

android:stateListAnimator="@null"

因此 z 轴顺序应低于您的 ImageView。如果您向 ImageView 添加一些高度,它也应该有效。

希望能帮到你。