Java – good UI Design: how to handle empty listview?

My application connects to the network and populates listview Sometimes nothing is returned What is the best way to notify users that the list is empty?

My own suggestions:

>Display "no results" in the first listitem > display a new view that says "no results"

Solution

Listview allows you to display another view when blank:

http://developer.android.com/reference/android/widget/AdapterView.html#setEmptyView (android.view.View)

In fact, if you use a listactivity and its layout has a view with Android: id = "@ Android: ID / empty", it will automatically hook you

Therefore, you can usually put listview and empty view in FrameLayout, and let the empty view display some good text in the center of its area to tell the user that nothing can be displayed

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>