首页 > 解决方案 > 如何设计这样的群聊

问题描述

如何设计群聊资料?

在此处输入图像描述

在此处输入图像描述

标签: androidiosswiftandroid-layoutuser-interface

解决方案


您只希望图片比其他图片高 1 吗?你可以使用RelativeLayout,它会把它们放在一起,然后你可以使用边距来根据需要移动它们。您也可以使用 toEndOf 参数,然后赋予负边距值以使它们部分重叠。例子

<RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">
        <ImageButton
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@null"
            android:id="@+id/test_1"
            android:src="@drawable/your_image_1"/>
        <ImageButton
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:background="@null"
            android:id="@+id/test_2"
            android:layout_toEndOf="@id/test_1"
            android:layout_marginStart="-20dp"
            android:src="@drawable/your_image_2"/>
        </RelativeLayout>

推荐阅读