devfeng
V2EX  ›  Android

求 v 站大佬们帮助,困扰我一个周末了, viewpager in listview,调用 notifyDataSetChanged 崩溃

  •  
  •   devfeng · Dec 9, 2019 · 14777 views
    This topic created in 2522 days ago, the information mentioned may be changed or developed.

    报错:No view found for id xxx (viewpager) for fragment xxx

    7 replies  •  2019-12-11 16:14:04 +08:00
    mouyase
    mouyase
    Dec 9, 2019
    1
    这边建议您按照字面意思先去排查一下呢
    Gehrman
    Gehrman
    Dec 9, 2019
    2
    listview 里放 viewpager 是什么场景?
    HollowKnight
    HollowKnight
    Dec 9, 2019
    3
    为何不用 RecyclerView+PagerSnapHelper??
    hikari
    hikari
    Dec 9, 2019
    4
    @Gehrman #2 淘宝 京东首页那种就是 RecyclerView + ViewPager + RecyclerView
    fansangg
    fansangg
    Dec 10, 2019
    5
    印象中 V7 包之后就在没用过 listview...现在我都忘记 listview 要怎么用了
    Gehrman
    Gehrman
    Dec 10, 2019
    6
    没代码想象不出来问题;
    用 NestedScrollView 做容器,ViewPager,RecyclerView 之类的布局按需添加进去感觉可以
    daiisdai
    daiisdai
    Dec 11, 2019
    7
    RecyclerView 做外部容器, 第一个 Item 嵌套一个横向 RecyclerView,使用 SnapHelper 实现 ViewPager 效果
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2791 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 14:10 · PVG 22:10 · LAX 06:10 · JFK 09:10
    ♥ Do have faith in what you're doing.