O'Reilly logo

React Native By Example by Richard Kho

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ScrollView example

This is how I updated AddExpensesModal to include a ScrollView:

// Expenses/app/components/AddExpensesModal/index.js ... import {   ...   ScrollView,   ... } from 'react-native'; ... export default class AddExpensesModal extends Component {   ...

Replace the modal's View with ScrollView. The maxHeight of the View inside is now height:

  render () {     ...     return (       <Modal         animationType={ 'slide' }         transparent={ false }         visible={ this.props.modalVisible }       >         <ScrollView style={ styles.modalContainer }>           ...           <View style={ [styles.expandableCellContainer,             { height: this.state.expanded ?             this.state.datePickerHeight : 40 }]}>             ...           </View>         </ScrollView>      </Modal>     )   } 

The outer View container that was the direct child of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required