Show TextView for an empty ListView inside a FrameLayout

前端 未结 4 1950
我寻月下人不归
我寻月下人不归 2021-01-28 09:18

I have a tabbed layout and an activity using tabs as views. It has three tabs as ListViews. If either of the lists is empty I want to show a simple TextView

4条回答
  •  庸人自扰
    2021-01-28 09:27

    I would insist you to use ViewStub here with a ListView inside a FrameLayout. When your ListView has data you can use VIEW.GONE to ViewStub and if your ListView is no data then use VIEW.VISIBLE for the ViewStub. You can download example from github and get it working.

提交回复
热议问题