是否有人成功实施了水平和垂直滚动的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();
}
}
}
谢谢,
答案 0 :(得分:0)
我找到了答案您只需将DirectionalViewPager作为库添加到项目中
此图片位于 Android-DirectionalViewPager-master \ Android-DirectionalViewPager-master \ library \ bin
并且你不要忘记从订单和导出标签中包含它