SwipeRefreshLayout can host only one direct child

后端 未结 2 884
遇见更好的自我
遇见更好的自我 2021-01-17 11:09

I added a \"pull to refresh\" to my listView, i also wanted to add an empty view when the list is empty - Now i got this error. How can i make this work? if im positioning a

2条回答
  •  野的像风
    2021-01-17 11:47

    SwipeRefreshLayout should be the parent in the XML file.

    You can use a FrameLayout as the child of SwipeRefreshLayout. The ListView and TextView (or any other empty state view) can be child views of the FrameLayout.

提交回复
热议问题