第一步:将无数据的View与ListView静态布局到RelativeLayout中
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<ListView
android:id="@+id/id_list_querytrouble"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ImageView
android:id="@+id/iv_bg_notrouble"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/bg_notrouble" />
</RelativeLayout>
第二步:在ListView数据为空的时候设置mListView.setEmptyView(iv_bg_notrouble);