Красиво размести элементы , можешь все перелопатить и даже добавить свои элементы ,…
- 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="200dp" app:cardCornerRadius="4dp" app:cardElevation="2dp">
code<RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/cardBackgroundImage" android:layout_width="match_parent" android:layout_height="match_parent" android:adjustViewBounds="true" android:scaleType="centerCrop" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:layout_alignParentBottom="true" android:text="Genre" android:textStyle="bold" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_alignParentEnd="true" android:layout_marginTop="16dp" android:text="Rating" android:textStyle="bold" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@id/cardBackgroundImage" android:layout_alignParentBottom="true" android:minHeight="72dp" android:orientation="horizontal" android:weightSum="1"> <ImageView android:id="@+id/icon1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.2" android:src="@drawable/icon1" /> <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_weight="0.6" android:text="Title" android:textAlignment="center" android:textColor="@color/white" android:textStyle="bold" /> <ImageView android:id="@+id/icon2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0.2" android:src="@drawable/icon2" /> </LinearLayout> </RelativeLayout> - Assistant
- User
что ты сделал?
- Assistant
Я внес некоторые изменения в разметку, чтобы сделать ее более красивой.
- Увеличил значение
cardCornerRadiusиcardElevationуCardView, чтобы создать закругленные углы и добавить тень. - Изменил цвет и размер текста у
genreTextViewиratingTextView, чтобы они были лучше видны на фоне изображения. - Изменил размер иконок
icon1иicon2, чтобы они были лучше видны и соответствовали размеру текста. - Добавил
idдляgenreTextViewиtitleTextView, чтобы можно было обратиться к ним из кода.
Это лишь предложение, и вы можете внести свои собственные изменения, чтобы сделать разметку еще более привлекательной.
- Увеличил значение