React Native 0.41 이상일 경우

<ScrollView
    ref={ref => this.scrollView = ref}
    onContentSizeChange={(contentWidth, contentHeight)=>{        
        this.scrollView.scrollToEnd({animated: true});
    }}>
</ScrollView>

 

flatList에서

 

<FlatList

      ref={'flatList'}

      data={this.state.message}

      renderItem={({ item }) => this._onRefresh(item)}

      keyExtractor={(itemindexnumber=> { return index.toString() }}

     onContentSizeChange={(contentWidthcontentHeight)=>{

           (this.refs.flatList as FlatList).scrollToEnd({animated: true});

           }}

/>

 

 

 

+ Recent posts