2017-11-07 3 views
1

私はReact Native RefreshコントロールをIOS上で動作させています。アンドロイドでネイティブのrefeshコントロールを反応させますか?

https://facebook.github.io/react-native/docs/refreshcontrol.html

私はアンドロイドシム上でそれを実行し、それが動作しません。

エラーは、未処理の約束拒否を示しています。 Android上でRefreshControlでScrollViewを使用するためにサポートされている場合、私は知らない

import React, { Component } from 'react'; 
import { 
    RefreshControl, 
} from 'react-native'; 

export default class Products extends Component { 
    _onRefresh() { 
    this.setState({refreshing: true}); 
    this.likedProducts() 
    } 

    render() { 
    return (
     <View style={styles.container}> 
     <ScrollView 
      contentContainerStyle={styles.scrollContent} 
      showsHorizontalScrollIndicator={false} 
      showsVerticalScrollIndicator={false} 
      refreshControl={ 
      <RefreshControl 
       refreshing={this.state.refreshing} 
       onRefresh={this._onRefresh.bind(this)} 
      /> 
      } 
     > 
     ... 
     </ScrollView> 
     </View> 
    } 
    } 
} 

答えて

1

:あなたが設定見ることができるようにここで

は、ファイルのバージョンをトリミングしています。代わりに https://facebook.github.io/react-native/docs/flatlist.htmlを使用することをお勧めします。ここでは、Android & iOSの両方にネイティブにプルーリフレッシュを統合しています。

0

アンドロイドとアイオスで動作することを確認できます。私が受け取ったエラーはどこか他の人からのものでした。

関連する問題