实现后的效果图:
代码:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f2f0eb"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/height_top_bar"
android:background="@color/common_top_bar_blue"
android:gravity="center_vertical" >
<LinearLayout
android:layout_width="45dp"
android:layout_height="match_parent"
android:background="@drawable/common_tab_bg"
android:onClick="back" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="9dp"
android:scaleType="centerInside"
android:src="@drawable/our_group_back_on" />
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="新建群聊"
android:textColor="#ffffff"
android:textSize="20sp" />
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="7dp" />
</RelativeLayout>
<include layout="@layout/search_bar" />
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent"
android:cacheColorHint="#00000000"
android:divider="#D4D4D4"
android:dividerHeight="1px"
android:fastScrollAlwaysVisible="false"
android:fastScrollEnabled="false" />
</LinearLayout>