ListView.setEmptyView不起作用

可能的原因1. 修改佈局文件,使得ListView和EmptyView是兄弟的關係,在一個parent佈局的下面。


例如:

<FrameLayout
        android:layout_width="match_parent"
        android:layout_height="0dip"
        android:layout_weight="1" >

    <ListView
            android:id="@+id/list_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    <ImageView
            android:id="@android:id/empty"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="#88000000"
            android:visibility="gone"/>
</FrameLayout>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章