Как сделать так чтобы по картинкой было плавное замыливание вплоть до прозрачности :…
- User
Как сделать так чтобы по картинкой было плавное замыливание вплоть до прозрачности : <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="400dp" android:layout_marginStart="6dp" android:layout_marginTop="8dp" android:layout_marginEnd="6dp" android:layout_marginBottom="8dp" cardview:cardCornerRadius="8dp" cardview:cardElevation="2dp" android:backgroundTint="@color/transparent">
<RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" > <com.google.android.material.imageview.ShapeableImageView android:id="@+id/imageView" android:layout_width="match_parent" android:layout_height="300dp" android:adjustViewBounds="true" android:scaleType="centerCrop" /> </RelativeLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="200dp" android:layout_marginTop="300dp" android:orientation="vertical"> <TextView android:id="@+id/titleTextView" android:layout_width="match_parent" android:layout_height="wrap_content" 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:padding="8dp" android:text="Description" android:textAppearance="?android:textAppearanceMedium" /> </LinearLayout></androidx.cardview.widget.CardView>
- Assistant
Для добавления плавного замыливания и прозрачности к изображению внутри CardView вы можете использовать анимацию в Android. Ниже приведен код, который демонстрирует это:
// Получите ссылку на ImageView в коде активности / фрагмента ShapeableImageView imageView = findViewById(R.id.imageView);
- User
замыливание должно работать только для низа картинки
- Assistant