ViewPager does not redraw content, remains/turns blank

前端 未结 13 898
萌比男神i
萌比男神i 2020-12-12 11:33

We\'re suffering from a very strange issue with ViewPager here. We embed lists on each ViewPager page, and trigger notifyDataSetChanged both on the list adapter and the view

13条回答
  •  执笔经年
    2020-12-12 11:58

    The Android Support Library has a demo Activity that includes a ViewPager with a ListView on every page. You should probably have a look and see what it does.

    In Eclipse (with Android Dev Tools r20):

    1. Select New > Android Sample Project
    2. Select your target API level (I suggest the newest available)
    3. Select Support4Demos
    4. Right-click the project and select Android Tools > Add Support Library
    5. Run the app and select Fragment and then Pager

    The code for this is in src/com.example.android.supportv4.app/FragmentPagerSupport.java. Good luck!

提交回复
热议问题