Nikita Kulikov
Nikita Kulikov

Reputation: 156

Place bottom right imageview in CardView

I can't move ImageView in bottom right. I try use Relative layout, but image not visible (Image under card.)

Android API 21. Use default style.

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>

Upvotes: 0

Views: 442

Answers (1)

Birki
Birki

Reputation: 26

I have used a RelativeLayout. On the item that should be in the background i used:

android:stateListAnimator="@null"

so the z-axis ordering should be lower than on your ImageView. It should also work if you add some elevation to your ImageView.

Hope I could help you.

Upvotes: 1

Related Questions