开发者

How to display a special message if a filtered list view contains no results any more?

Is there any way to show a message such as "No results" when i filte开发者_如何学Cr a list?


Easy. Next to your list view, add this text view:

<TextView android:id="@id/android:empty"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:text="@string/empty_list_message"/>

The ID is important; the ListActivity will look for it.

Emmanuel

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜