开发者

Recycling views, listview inside scrollview

开发者 https://www.devze.com 2023-04-13 07:13 出处:网络
I am aware of recycling of views in LiveView, I am also aware that we cannot have a listview as a child of scroll view, which just scrambles the scrolling up.

I am aware of recycling of views in LiveView, I am also aware that we cannot have a listview as a child of scroll view, which just scrambles the scrolling up.

I know the work around of using LinearLayout or any other viewgroup and add components to it. Which is much feasible, but I like my app tuned, and I want to recycle views when I am implement开发者_Python百科ing the workaround.

If I inflate once and try to add that view, an exception occures and asks me first call removeView() on parent.

Can any one tell me other workaround if there's one, or how can I implement recycling in this scenario ?


It's possible to disable the scrolling of a ListView by creating a custom ListView component and overriding the dispatchTouchEvent() method. This will let you embed a ListView within a ScrollView container. Take a look at my answer for:

Adapter for a List displayed inside a Scroll View, non-Scrolling List View?

0

精彩评论

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

关注公众号