比较MessageListActivity使用不同的layout

<?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:orientation="vertical"
    android:background="@drawable/wall_paper" >
    <RelativeLayout
        android:id="@+id/title_bar"
        style="@style/TopBar" >

        <ImageView
            android:id="@+id/left_corner"
            android:layout_width="44dip"
            android:layout_height="fill_parent"
            android:scaleType="fitXY"
            android:src="@drawable/totem_upper_right" />

        <!-- 标题 -->
        <TextView
            android:id="@+id/title_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:textColor="#ffffff"
            android:textSize="@dimen/activity_title_andbottom_button_text_size"
            android:textStyle="bold" />

        <ImageView
            android:id="@+id/right_corner"
            android:layout_width="44dip"
            android:layout_height="fill_parent"
            android:scaleType="fitXY"
            android:layout_alignParentRight="true"
            android:src="@drawable/totem_upper_left" />
        <ImageButton
            android:id="@+id/call"
            android:layout_width="35dip"
            android:layout_height="35dip"
            android:layout_centerVertical="true"
            android:layout_marginRight="7dip"
            android:layout_toLeftOf="@id/right_corner"
            android:background="@drawable/imb_msg_call_style" />
    </RelativeLayout>
    <ListView
        android:id="@+id/message_list"
        android:layout_width="fill_parent"
        android:layout_height="0dip"
        android:layout_weight="1"
        android:cacheColorHint="@android:color/transparent"
        android:divider="@null"
        android:fadingEdge="none"
        android:fastScrollEnabled="true"
        android:listSelector="@android:color/transparent"
        android:scrollbars="none"
        android:stackFromBottom="true" >
    </ListView>

    <LinearLayout
        android:id="@+id/layout_editor"
        android:paddingLeft="10dip"
        android:paddingRight="10dip"
        android:paddingTop="5dip"
        android:paddingBottom="5dip"
        android:layout_margin="0dip"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@color/gray3"
        android:orientation="horizontal" >

        <EditText
            android:id="@+id/edit_msg"
            android:textSize="16dip"
            android:maxLines="10"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginRight="5dp"
            android:background="@drawable/sms_text_input"
            android:focusable="true"
            android:focusableInTouchMode="true" />

        <Button
            android:id="@+id/send_msg"
            android:text="发送"
            android:textColor="#FFFFFF"
            android:textSize="18dip"
            android:textStyle="bold"
            android:gravity="center"
            android:padding="5dip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:background="@drawable/sms_send_button"/>
    </LinearLayout>
</LinearLayout>

----

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/wall_paper" >
    <RelativeLayout
        android:id="@+id/title_bar"
        style="@style/TopBar" >

        <ImageView
            android:id="@+id/left_corner"
            android:layout_width="44dip"
            android:layout_height="fill_parent"
            android:scaleType="fitXY"
            android:src="@drawable/totem_upper_right" />

        <!-- 标题 -->
        <TextView
            android:id="@+id/title_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:textColor="#ffffff"
            android:textSize="@dimen/activity_title_andbottom_button_text_size"
            android:textStyle="bold" />

        <ImageView
            android:id="@+id/right_corner"
            android:layout_width="44dip"
            android:layout_height="fill_parent"
            android:scaleType="fitXY"
            android:layout_alignParentRight="true"
            android:src="@drawable/totem_upper_left" />
        <!-- 创建信息按钮 -->
        <ImageButton
            android:id="@+id/call"
            android:layout_width="35dip"
            android:layout_height="35dip"
            android:layout_centerVertical="true"
            android:layout_marginRight="7dip"
            android:layout_toLeftOf="@id/right_corner"
            android:background="@drawable/imb_msg_call_style" />
    </RelativeLayout>

    <LinearLayout
        android:id="@+id/layout_editor"
        android:paddingLeft="10dip"
        android:paddingRight="10dip"
        android:paddingTop="5dip"
        android:paddingBottom="5dip"
        android:layout_margin="0dip"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="@color/gray3"
        android:orientation="horizontal" >

        <EditText
            android:id="@+id/edit_msg"
            android:textSize="16dip"
            android:maxLines="10"
            android:layout_width="0dp"
            android:layout_weight="1"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginRight="5dp"
            android:background="@drawable/sms_text_input"
            android:focusable="true"
            android:focusableInTouchMode="true" />

        <Button
            android:id="@+id/send_msg"
            android:text="发送"
            android:textColor="#FFFFFF"
            android:textSize="18dip"
            android:textStyle="bold"
            android:gravity="center"
            android:padding="5dip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:background="@drawable/sms_send_button"/>
    </LinearLayout>

    <ListView
        android:id="@+id/message_list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@id/layout_editor"
        android:layout_below="@id/title_bar"
        android:cacheColorHint="@android:color/transparent"
        android:divider="@null"
        android:fadingEdge="none"
        android:fastScrollEnabled="true"
        android:listSelector="@android:color/transparent"
        android:scrollbars="none"
        android:stackFromBottom="true" >
    </ListView>
</RelativeLayout>

你可能感兴趣的:(ListActivity)