React-native-image-viewer: Can't move or hide photo counter

Created on 1 Jun 2017  路  6Comments  路  Source: ascoders/react-native-image-viewer

If you want to use renderHeader it could be a problem:

snimek obrazovky 2017-06-01 v 17 25 17

It would be nice to have a prop with custom styles.

Most helpful comment

If you want to remove the counter you'll need a function:
renderIndicator={() => null}

renderIndicator={null} (this will not work)

All 6 comments

Try add styles to the element returned by renderHeader?

I know that I can move the title, but counter is in usual title's place. I would prefer to move counter somewhere and keep title as it is.

@jvaclavik , you can rewrite counter by pass renderIndicator to it.

<ImageViewer renderIndicator={ (currentIndex, allSize) => {
  return <div style={...}>{currentIndex} / {allSize}</div>
} }/>

If you want to remove the counter you'll need a function:
renderIndicator={() => null}

renderIndicator={null} (this will not work)

ATTENTION

@jvaclavik is true but if you want set renderIndicator you should set styles with position:"absolute", zIndex: 1, top: 0, left: 0 ...

@KA5558 Yes, it's a bit troublesome, but there are more possibilities for doing something special.

Was this page helpful?
0 / 5 - 0 ratings