그래서 나는 메시지가 담긴 메시지 컨테이너만큼 채팅하고 싶습니다. 있는 내가 고민하고, 여기에 http://img.creativemark.co.uk/uploads/images/805/15805/img3File.png텍스트 메시지의 내용과 같은 대화방
내 레이아웃은 다음과 같습니다 :
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/single_message_view"
android:layout_margin="5dp">
<LinearLayout
android:layout_marginEnd="15dp"
android:layout_marginStart="15dp"
android:layout_alignParentEnd="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="100dp"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="author"
android:id="@+id/sender_data"
android:layout_marginEnd="5dp"
android:textColor="@color/colorWhite" />
<TextView
android:layout_width="wrap_content"
android:layout_weight="1"
android:textAlignment="textEnd"
android:layout_height="wrap_content"
android:text="date"
android:textColor="@color/colorWhite"
android:id="@+id/send_date" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/message_content"
android:background="@drawable/msg_haze"
>
<TextView
android:layout_margin="10dp"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/colorWhite"
android:id="@+id/message_text"
android:text="content" />
<LinearLayout
android:layout_margin="10dp"
android:minWidth="100dp"
android:layout_below="@id/message_text"
android:id="@+id/tags_container"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:id="@+id/message_tags"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="LinearLayoutManager"
tools:listitem="@layout/item_tag" />
</LinearLayout>
<ImageView
android:layout_marginBottom="10dp"
android:layout_marginEnd="10dp"
android:paddingBottom="10dp"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_width="15dp"
android:layout_height="15dp"
android:id="@+id/message_state" />
<LinearLayout
android:id="@+id/attachment_holder"
android:layout_marginTop="10dp"
android:padding="5dp"
android:visibility="gone"
android:orientation="vertical"
android:layout_alignParentBottom="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/attachments_haze">
<android.support.v7.widget.RecyclerView
android:id="@+id/attachments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layoutManager="GridLayoutManager"/>
<ImageView
android:id="@+id/attachment"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
난 당신이 문제의 이미지 참조를 열 수있는 경우, 단색 간단한 사각형 상자 인클로저가있는 한이 습관이 특정 질문에 대한 필요가 생각하는 수 drawable 자체를 사용하여 얻을 수 있습니다. 9 패치 이미지가 필요 없습니다. 배경을 위해 색상 드로어 블을 사용하여 논리적으로 레이아웃을 설정하십시오. 레이아웃 전체 게시. – Mit
그럴 수도 있습니다. 그러나 그것은 단지 참고 일뿐입니다. 대부분의 (전부는 아님) 채팅 거품은 9 가지 패치 이미지로 만들어집니다. –
예, 당신은 절대적으로 옳습니다. 나는 "이 특별한 문제에 대해서는 필요하지 않습니다"라고 말했습니다. – Mit