Extends the native ScrollView from React Native with a custom scrollindicator. That indicator stays visible als long it is activated.
The native ScrollView does not indicate that there is more content accessable by scrolling the element. Reason is the disapearing indicator by the native element after scrollig. And it is not even visible after rednering the page. So for those who want to show an indicator permanant they can use this package.
npm install react-native-scrollview-indicator --save
import { ScrollViewIndicator } from "react-native-scrollview-indicator";
<ScrollViewIndicator
contentData={this.dataArray}
customIndicator={true}
customIndicatorWidth={5}
customIndicatorColor={'red'}
/>
Any ScrollView
property and the following:
Prop | Description | Default |
---|---|---|
contentData |
The content for the ScrollView. Same like before, Array of Views.. | None |
customIndicator |
If true, the custom indicator is visible | false |
customIndicatorWidth |
The width of the indicator. | 3 |
customIndicatorColor |
The color of the indicator | 'grey' |
-
At this moment the custom indicator is just for vertical scrolling. In coming updates it will be available for horizontal scrolling as well.
-
The height is determinant automatically by the size of the content and the size of the ScrollView. So no need to think about that.
MIT.