开发者

Android. Empty ListView. Custom message. Very confusing behavior, can't make sense of it

开发者 https://www.devze.com 2023-04-13 01:10 出处:网络
I have a ListView (part of a ListFragment), and I noticed that when the list is empty, the message below appears (No matching activities found).

I have a ListView (part of a ListFragment), and I noticed that when the list is empty, the message below appears (No matching activities found).

  1. I want to replace that message with a View.

  2. I've tried setEmptyView(View emptyView).

  3. When I do not use setEmptyView, the message disappears when list is populated (correct, but I still want 1 above).

  4. When I use setEmptyView, the emptyView disappears when list is populated (correct). However, that text message is still there (see figure 1). And worse! Now it doesn't disappear even when list is populated (see figure 开发者_JS百科2: shouldn't it behave just like on 3?).

  5. Where does this message come from? the aether? How do I remove it?!?

Android. Empty ListView. Custom message. Very confusing behavior, can't make sense of it

Android. Empty ListView. Custom message. Very confusing behavior, can't make sense of it


I had a similar issue with ListFragment. I create a layout with the ListView and a View (an ImageView in my case) with the id: android:id="@id/android:empty", and worked like a charm..

0

精彩评论

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

关注公众号