【问题标题】:How to create a chat screen similar to whatsapp in material design?如何在 Material Design 中创建类似于 whatsapp 的聊天屏幕?
【发布时间】:2015-08-18 22:13:32
【问题描述】:

基本上,我对每个聊天条目的 xml 文件感到困惑,其中包含像 whatsapp 一样包装的内容。我曾尝试使用framelayoutRelativelayout 进行操作,但没有成功。消息未环绕时间。

 <FrameLayout
        android:id="@+id/chat_mine"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:background="@drawable/chat_bg_white"
       >


        <TextView
            android:id="@+id/chat_text_mine"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="65dp"
            android:gravity="center|left"
            android:text="h"
            android:textSize="@dimen/font_size3" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|right"
            >

            <TextView
                android:id="@+id/chat_time_mine"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="right|bottom"
                 android:gravity="right|bottom"
                android:singleLine="true"
                android:text=" 2:00 am"
                android:textSize="@dimen/font_size4" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/ic_delivered" />
        </LinearLayout>

    </FrameLayout>

【问题讨论】:

    标签: android user-interface android-layout material-design whatsapp


    【解决方案1】:

    不确定您想在这里问什么?如果我理解正确,请编辑您的框架布局以首先显示一些内容。这将帮助您在预览中查看内容。

    <FrameLayout
        android:id="@+id/chat_mine"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:background="@drawable/chat_bg_white"
       >
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-28
    • 1970-01-01
    • 2018-12-03
    • 2010-09-19
    • 1970-01-01
    相关资源
    最近更新 更多