Сделай так чтобы текст был на фоне картинки а сама картинка заполняла весь объем…
- User
Сделай так чтобы текст был на фоне картинки а сама картинка заполняла весь объем карточки , но помни что это карточка часть RecycleView : <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cardview="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginStart="4dp" android:layout_marginTop="8dp" android:layout_marginEnd="4dp" android:layout_marginBottom="8dp" cardview:cardCornerRadius="8dp" cardview:cardElevation="2dp">
code<RelativeLayout android:layout_width="match_parent" android:layout_height="200dp"> <com.google.android.material.imageview.ShapeableImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="120dp" android:adjustViewBounds="true" android:scaleType="centerCrop" /> <TextView android:id="@+id/titleTextView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/imageView" android:padding="8dp" android:text="Title" android:textAppearance="?android:textAppearanceLarge" /> <TextView android:id="@+id/descriptionTextView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/titleTextView" android:padding="8dp" android:text="Description" android:textAppearance="?android:textAppearanceMedium" /> </RelativeLayout></androidx.cardview.widget.CardView>
- Assistant
Чтобы текст был на фоне картинки, а сама картинка заполняла весь объем карточки внутри RecyclerView, нужно добавить небольшую модификацию в xml-разметку.