dialog:
private void showDialog(JSONObject object,TbgcActivity context) {
View view = LayoutInflater.from(this).inflate(R.layout.dialog_dc_tbgc, null);
ListView lvGc = (ListView) view.findViewById(R.id.lv_dwgc_tbgc_dialog);
//addFooterView的参数为一个View就可以。LayoutInflater.from参数是context,我用的是Fragment所以用getActivity()获取context。
//listview_foot_view是一个布局文件,直接new一个控件作为addFooterView的参数貌似也是可以的
lvGc.addFooterView(LayoutInflater.from(this).inflate(R.layout.listview_foot_view, null));
....
....
....
}
listview_foot_view:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="50dp"
android:background="@color/grayList"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="50dp"
android:src="@color/grayList"
/>
</LinearLayout>
如下图的dialog的确定按钮的上方的深灰色部分