question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hide dots and pagination

See original GitHub issue

Version

  • react-native-swiper v1.5.13
  • react-native: 0.50.3

Problem

I have 4 Views inside a Swiper component and showing 4 Dot, one Dot for each View.

I would like to keep 4 Views, but only show 3 Dot. 4th View should not be a visible element of the Pagination but should still be part of the Swiper component. Pagination should be hidden on the 4th View as well.

Example

4 Views but only 3 Dot

1st View

Pagination is visible and has 3 Dots.

  • 1st Dot is active.
  • 2nd Dot is inactive.
  • 3rd Dot is inactive.
  • 4th Dot is not visible.

2nd View

Pagination is visible and has 3 Dots.

  • 1st Dot is inactive.
  • 2nd Dot is active.
  • 3rd Dot is inactive.
  • 4th Dot is not visible.

3rd View

Pagination is visible and has 3 Dots.

  • 1st Dot is inactive.
  • 2nd Dot is inactive.
  • 3rd Dot is active.
  • 4th Dot is not visible.

4th View

Pagination is not visible.

  • 1st Dot is inactive.
  • 2nd Dot is inactive.
  • 3rd Dot is inactive.
  • 4th Dot is not visible.

Research

It seems like this number is responsible for the number of visible Dot components. Here it is being used to build the Dot components.

Summary

Is there any better approach to achieve what i’m asking for without touching these lines?

Maybe a hidden feature i’m missing to hide / remove Dots and Pagination for a given View index?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

12reactions
havinhthaicommented, Apr 17, 2018

@mianusmankhalid This is my code, hope it can help you.

` export default class IntroSwipe extends Component { state = { showPaginate: true, }

indexChanged = (index) => {
    if (index === 2) {
        this.setState({ showPaginate: false });
    } else {
        this.setState({ showPaginate: true });
    }
}

render() {
    return (
        <Swiper
            loop={false}
            activeDotStyle={{ backgroundColor: 'transparent', borderWidth: 1, borderColor: '#fff' }}
            onIndexChanged={index => this.indexChanged(index)}
            showsPagination={this.state.showPaginate}
        >
            <View><Text>Section one</Text></View>

            <View><Text>Section two</Text></View>

            <View><Text>Section three</Text></View>
        </Swiper>
    );
}

} `

1reaction
mianusmankhalidcommented, Apr 17, 2018

It should be like this.

1st View Pagination is visible and has 3 Dots.

1st Dot is active. 2nd Dot is inactive. 3rd Dot is inactive. 4th Dot is not visible.

2nd View Pagination is visible and has 3 Dots.

1st Dot is inactive. 2nd Dot is active. 3rd Dot is inactive. 4th Dot is not visible.

3rd View Pagination is visible and has 3 Dots. When select 3rd View it should slide to left

1st Dot is not visible. 2nd Dot is inactive. 3rd Dot is active. 4th Dot is inactive.

4th View Pagination is visible and has 3 Dots. 1st Dot is not visible. 2nd Dot is inactive. 3rd Dot is inactive. 4th Dot is active.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to hide pagination dots · Issue #226 · Jacse/react-native ...
I have lots of screen and I want to hide pagination dots at the bottom because it renders too many dots . How...
Read more >
How to disable pagination dots in Swiper with Center Mode?
I want to use the "Center" mode, but without the page dots at the bottom. I have tried several suggested solutions, but the...
Read more >
"Hiding Pagination Dots" (#3052026) / ThemeNectar
Hey, I'm using the fickity carousel. I want to hide the pagination dots on the iPad and phone (I only want the pagination...
Read more >
How to remove Pagination truncation - Envira Gallery
Would you like to remove the pagination truncation from paginated Envira galleries? These are the 3 dots that appear in between the page ......
Read more >
Pagination - Splide
From the version 4.1, the omitEnd option allows you to omit these dots, and also disable the next arrow when the carousel reaches...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found