专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > Android

android QQ和微信 聊天页面的一个有关问题!内有详细说明

发布时间:2010-05-30 10:56:26 文章来源:www.iduyao.cn 采编人员:星星草
android QQ和微信 聊天页面的一个问题!!!!!!内有详细说明
界面简化一下,一个listview显示消息队列,一个横向linearlayout显示一个文本框和一个输入按钮,一个横向linearlayout显示两个图片button,上下顺序也是这个顺序,下面两个linearlayout放在底部, 我是通过设置layout_weight的方式实现的,代码如下
XML code
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:background="@color/gray" android:orientation="vertical">
    <LinearLayout android:id="@+id/body" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:layout_weight="1"
        android:orientation="vertical" android:weightSum="1">
        <ListView android:id="@+id/chat_list" android:cacheColorHint="@null"
            android:divider="@drawable/divider_group" android:groupIndicator="@drawable/expand_group"
            android:listSelector="@drawable/list_alpha_selector"
            android:transcriptMode="alwaysScroll" android:layout_height="346dp"
            android:layout_weight="1.05" android:layout_width="wrap_content" />
        <LinearLayout android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_weight="0"
            android:background="@color/gray_blue" android:gravity="center_vertical">
            <Button android:id="@+id/chat_emotion" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_weight="0"
                android:background="@drawable/chat_emotion_selector" />
            <EditText android:id="@+id/chat_input" android:layout_width="fill_parent"
                android:layout_height="fill_parent" android:layout_weight="1"
                android:background="@drawable/chat_input_selector"
                android:singleLine="true" />
            <Button android:id="@+id/chat_send" android:layout_width="wrap_content"
                android:layout_height="wrap_content" android:layout_weight="0"
                android:background="@drawable/button" android:onClick="onClick"
                android:text="发送" android:textColor="@color/white" android:textSize="18dip" />
        </LinearLayout>
    </LinearLayout>
    <LinearLayout android:id="@+id/bottom"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:layout_weight="0" android:background="@drawable/bottom">
        <LinearLayout android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_weight="1"
            android:gravity="center_horizontal">
            <ImageButton android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true" android:background="@drawable/option_selector" />
        </LinearLayout>
        <LinearLayout android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:layout_weight="1"
            android:gravity="center_horizontal">
            <ImageButton android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true" android:background="@drawable/add_selector" />
        </LinearLayout>
    </LinearLayout>
</LinearLayout>
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。

其他相似内容:

热门推荐: