How can i have a ListView inside a NestedScrollView

后端 未结 4 1682
盖世英雄少女心
盖世英雄少女心 2021-01-05 07:52

I have created an app with a page that need to load content dynamically from web service. I want to have listview that can scroll together with a linear layout inside Nested

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-05 07:58

    Well, I would suggest you 2 ways to solve that problem:

    1) Try to make LinearLayout a header of your ListView. Note that header should be inflated as it is written here.

    2) You mentioned that you use NestedScrollView, so maybe you should also try to replace ListView inside NestedScrollView with LinearLayout, as wise people suggested here, adding row views in loop similar to how your adapter works.

    Good luck!

提交回复
热议问题