React Native:使用webview在Android中进行过度滚动效果

时间:2018-04-14 10:55:08

标签: android react-native webview

如何在使用React Native在Android上滚动时隐藏顶部的过度滚动效果?这是代码:

import React from 'react';
import { StyleSheet, View, WebView } from 'react-native';
import { Constants } from 'expo';


export default class App extends React.Component {

  render() {
    return (
      <View style={styles.container}>
        <View style={styles.statusBar} />
        <WebView
          source={{uri: 'https://example.com'}}
          renderError={() => alert('Merci de vérifier votre connexion Internet', 'Internet non disponible')}
        />
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
  statusBar: {
    backgroundColor: "#1D3B57",
    height: Constants.statusBarHeight,
  }
});

Result with white effect。 谢谢。

0 个答案:

没有答案