Im пытается создать этот макет (извините за качество, это все, что у меня есть): Как сделать макет с цветной полосой позади текста и изображений
До сих пор я построил этот
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="12dp">
<ImageView xmlns:tools="http://schemas.android.com/tools"
android:layout_width="48dp"
android:layout_height="48dp"
android:id="@+id/UserPhotoImageView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginRight="16dp" />
<TextView
android:text="UserName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="normal"
android:typeface="normal"
android:textSize="16dp"
android:layout_toRightOf="@+id/UserPhotoImageView"
android:layout_alignTop="@+id/CalendarImageView"
android:id="@+id/UserNameTextView"
android:textColor="#333333" />
<TextView
android:text="Date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:typeface="normal"
android:textSize="12dp"
android:id="@+id/DateTextView"
android:gravity="top"
android:layout_toLeftOf="@+id/CalendarImageView"
android:layout_alignTop="@+id/CalendarImageView" />
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:gravity="top"
android:id="@+id/CalendarImageView"
android:layout_alignParentRight="true"
android:layout_marginLeft="6dp"
android:src="@drawable/ic_calendar_icon"
android:backgroundTint="#ffffffff" />
<TextView
android:text="Comment"
android:layout_below="@+id/UserNameTextView"
android:layout_alignLeft="@+id/UserNameTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:typeface="normal"
android:textSize="14dp"
android:id="@+id/UserCommentTextView" />
</RelativeLayout>
Который дал мне первую часть, как я хочу для того чтобы достигнуть этого:
Теперь для последней строки, я знаю, как сделать округлое изображение, но как я могу поместить изображение и текст за цветную полосой ?
спасибо, я не могу понять в этом коде, где отображается в строке – CDrosos
Исправлены некоторые ошибки ... Смотрите в верхней , у него есть 'android: layout_below =" @ + id/UserCommentTextView ", это будет в вашем' RelativeLayout'. Работа по очистке чуть-чуть прямо сейчас –
Верхнее и нижнее поля должны быть заполнены, исправлены, что ... это выглядит точно так же, как и ваше изображение –