1.ViewPager使用非常卡顿问题:
我的代码中出现如此问题是因为我的布局中同时出现了两个渲染的页面。从而使得ViewPager使用起来非常卡顿。
2.去掉ViewPager下方的指示栏(小圆点):
2.1:打开ViewPager.js
2.2:找到render()。移到render类的最后,然后更改代码
更改前代码:
{{/*
以下是原始小圆点代码。
将pageCount和scrollOffset设置为0后可以隐藏小圆点的显示-->
pageCount: pageIDs.length,
activePage: this.state.currentPage,
scrollValue: this.state.scrollValue,
scrollOffset: this.childIndex,*/}
更改后代码:
{this.renderPageIndicator({goToPage: this.goToPage,
pageCount: 0,
activePage: this.state.currentPage,
scrollValue: this.state.scrollValue,
scrollOffset: 0,
})}
暂时的话我就用的这个方法。然后使用的是时候也没有问题。
觉得可以的话,就给个赞赏吧!