2



有没有人成功实现了水平和垂直滚动的 ViewPager?

我知道Directional ViewPager,当我使用它时

<i>31 12:11:29.954: E/AndroidRuntime(14670): java.lang.NoClassDefFoundError: com.directionalviewpager.DirectionalViewPager$DataSetObserver
10-31 12:11:29.954: E/AndroidRuntime(14670):    at com.directionalviewpager.DirectionalViewPager.setAdapter(DirectionalViewPager.java:164)</i>

第 164 行:mObserver = new DataSetObserver();

public void setAdapter(PagerAdapter adapter) {
    if (mAdapter != null) {
        VerticalViewPagerCompat.setDataSetObserver(mAdapter, null);
    }

    mAdapter = adapter;

    if (mAdapter != null) {
        if (mObserver == null) {
            mObserver = new DataSetObserver();
        }
        VerticalViewPagerCompat.setDataSetObserver(mAdapter, mObserver);
        mPopulatePending = false;
        if (mRestoredCurItem >= 0) {
            mAdapter.restoreState(mRestoredAdapterState, mRestoredClassLoader);
            setCurrentItemInternal(mRestoredCurItem, false, true);
            mRestoredCurItem = -1;
            mRestoredAdapterState = null;
            mRestoredClassLoader = null;
        } else {
            populate();
        }
    }
}

谢谢,

4

1 回答 1

0

我找到了您的答案您只需将 DirectionalViewPager 作为库添加到您的项目中

将此图像添加为外部库

此库位于Android-DirectionalViewPager-master\Android-DirectionalViewPager-master\library\bin

而且你不要忘记从订单和导出选项卡中包含它

于 2013-10-31T07:16:04.760 回答