Gestures

Button

<Button
  onPress={() => {
    alert('You tapped the button!');
  }}
  title="Press Me"
  color="#841584"
/>

onLongPress

onPress

Touchables

Create your own buttons with touchable

Scrolling

ScrollView

Props

  • pagingEnabled

  • maximumZoomScale and minimumZoomScale props use gestures to zoom in and out

import React, { Component } from 'react';
import { ScrollView, Image, Text } from 'react-native';

export default class IScrolledDownAndWhatHappenedNextShockedMe extends Component {
  render() {
      return (
        <ScrollView>
          <Text style={{fontSize:96}}>Scroll me plz</Text>
          <Image source={{uri: "https://facebook.github.io/react-native/img/tiny_logo.png", width: 64, height: 64}} />
        </ScrollView>
      );
  }
}

Last updated