【发布时间】:2014-10-23 12:10:24
【问题描述】:
我正在尝试创建一个类似于 whatsapp 聊天的布局,我有一个 9 补丁图像,但我不能像下图那样做:
目前看起来像这样:
我的 axml 文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<TextView
android:id="@+id/singleMessage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:layout_margin="5dip"
android:paddingLeft="10dip"
android:text="Hello bubbles!"
android:textColor="#48026E" />
<TextView
android:id="@+id/dateTime"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="right"
android:text="00:00"
android:textColor="#48026E" />
【问题讨论】:
-
不清楚你在问什么。你能详细说明一下吗?
-
@Funkystein 我的文字不适合布局,它就像两个块而不是第一张图片(whatsapp 气泡)
-
1 - 为什么要在气泡中描出黑色区域? 2 - 是的,它是 2 个文本,每个文本都有自己的风格。 3 - 您的布局不完整。 4 - 我更喜欢使用相对布局。 5 - 将气泡 9 补丁分配给容器。
标签: android android-layout android-linearlayout