React-Native-ViewPager icon indicating copy to clipboard operation
React-Native-ViewPager copied to clipboard

How can we put some customized page indicator

Open MahmoodBakhshayesh opened this issue 6 years ago • 1 comments

hi , how can we put a customized page indicator such as something like 1/30 which shows we are in page 1 from 30 total , or some sort of loading bar which full by going forward or some progress bar

MahmoodBakhshayesh avatar May 07 '18 09:05 MahmoodBakhshayesh

You can create your own component, let's say something like a ProgressBar component and then feed it a width or complete % with a state param...

<IndicatorViewPager onPageSelected={this.yourOnPageSelected} ...>
...

yourOnPageSelected = (params) => {
  this.setState({
    progress: ((params.position + 1) / numOfSteps),
  });
}

tonycoco avatar Aug 13 '18 18:08 tonycoco