GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • ReScript React Native
  • Docs
  • Components
  • APIs
  • Blog
  • GitHub
  • ActivityIndicator
  • Button
  • DrawerLayoutAndroid
  • FlatList
  • Image
  • ImageBackground
  • InputAccessoryView
  • KeyboardAvoidingView

This view

  • Original page
  • New address

GeezerVison is showing rescript-react-native.github.io — ScrollView | ReScript React Native

Methods​

scrollTo​

Scrolls to a given x, y offset, either immediately or with animation (animated). On Android you may also pass duration.

type scrollToOptions = {
x: float,
y: float,
animated?: bool,
duration?: float,
}

scrollTo: (element, scrollToOptions) => unit

Example​

open ReactNative

@react.component
let make = () => {
let scrollViewRef = React.useRef(Nullable.null)

<ScrollView ref={scrollViewRef->Ref.value}>
<TouchableOpacity
onPress={_ =>
switch scrollViewRef.current->Nullable.toOption {
| Some(scrollView) =>
scrollView->ScrollView.scrollTo({x: 0., y: 0., animated: true})
| None => ()
}}>
<Text> {"ScrollTo 0, 0"->React.string} </Text>
</TouchableOpacity>
</ScrollView>
}

scrollToEnd​

Scrolls to the end of the ScrollView (bottom for vertical, right for horizontal). Optional animation options:

type scrollToEndOptions = {animated?: bool, duration?: float}

scrollToEnd: (element, ~options: scrollToEndOptions=?) => unit
scrollView->ScrollView.scrollToEnd(~options={animated: true})

flashScrollIndicators​

flashScrollIndicators: element => unit
  • Methods
    • scrollTo
    • scrollToEnd
    • flashScrollIndicators
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.