Исправь внешний вид и добавь возможно пролистывать эти изображения , :…
- User
Исправь внешний вид и добавь возможно пролистывать эти изображения , : <androidx.cardview.widget.CardView xmlns:android=“http://schemas.android.com/apk/res/android” xmlns:app=“http://schemas.android.com/apk/res-auto” android:layout_width=“match_parent” android:layout_height=“match_parent” android:layout_marginStart=“4dp” android:layout_marginTop=“8dp” android:layout_marginEnd=“4dp” android:layout_marginBottom=“8dp” android:backgroundTint=“@color/transparent”>
<androidx.cardview.widget.CardView android:layout_width=“150dp” android:layout_height=“200dp” android:layout_marginStart=“230dp” android:layout_marginTop=“8dp” android:layout_marginEnd=“4dp” android:layout_marginBottom=“8dp” android:elevation=“2dp” android:rotationY=“16”>
<ImageView android:id=“@+id/right_image” android:layout_width=“match_parent” android:layout_height=“match_parent” android:adjustViewBounds=“true” android:rotationX=“0” android:scaleType=“centerCrop” /> </androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView android:layout_width=“150dp” android:layout_height=“200dp” android:layout_marginStart=“5dp” android:layout_marginTop=“8dp” android:layout_marginEnd=“4dp” android:layout_marginBottom=“8dp” android:elevation=“2dp” android:rotationY=“-16”>
<ImageView android:id=“@+id/left_image” android:layout_width=“match_parent” android:layout_height=“match_parent” android:adjustViewBounds=“true” android:scaleType=“centerCrop” /> </androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView android:layout_width=“150dp” android:layout_height=“200dp” android:layout_marginStart=“120dp” android:layout_marginTop=“4dp” android:layout_marginEnd=“4dp” android:layout_marginBottom=“8dp” android:elevation=“10dp”>
<ImageView android:id=“@+id/middle_image” android:layout_width=“match_parent” android:layout_height=“match_parent” android:adjustViewBounds=“true” android:scaleType=“centerCrop” /> </androidx.cardview.widget.CardView>
</androidx.cardview.widget.CardView>
- Assistant
<androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <androidx.cardview.widget.CardView android:layout_width="150dp" android:layout_height="200dp" android:layout_marginStart="4dp" android:layout_marginTop="8dp" android:layout_marginEnd="4dp" android:layout_marginBottom="8dp" android:elevation="2dp" android:rotationY="16"> <ImageView android:id="@+id/right_image" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:scaleType="centerCrop" /> </androidx.cardview.widget.CardView> <androidx.cardview.widget.CardView android:layout_width="150dp" android:layout_height="200dp" android:layout_marginStart="5dp" android:layout_marginTop="8dp" android:layout_marginEnd="4dp" android:layout_marginBottom="8dp" android:elevation="2dp" android:rotationY="-16"> <ImageView android:id="@+id/left_image" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:scaleType="centerCrop" /> </androidx.cardview.widget.CardView> <androidx.cardview.widget.CardView android:layout_width="150dp" android:layout_height="200dp" android:layout_marginStart="120dp" android:layout_marginTop="4dp" android:layout_marginEnd="4dp" android:layout_marginBottom="8dp" android:elevation="10dp"> <ImageView android:id="@+id/middle_image" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:scaleType="centerCrop" /> </androidx.cardview.widget.CardView> </LinearLayout> - User
что ты сделал?
- Assistant
Я обернул существующий код в
NestedScrollViewиLinearLayout, чтобы добавить возможность прокручивать изображения. Теперь всеCardViewс изображениями будут находиться внутриNestedScrollView, которая предоставляет функционал прокрутки, если содержимое не помещается на экране. - User
теперь улучши внешний вид , помни это это один из элементов recycleView
- Assistant
<androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView android:layout_width="match_parent" android:layout_height="match_parent" android:padding="8dp" android:clipToPadding="false" /></androidx.core.widget.NestedScrollView>
- Assistant
<androidx.recyclerview.widget.RecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingHorizontal="8dp" />