【发布时间】:2017-07-22 16:33:41
【问题描述】:
我正在尝试在 webweb 中显示加载指示器,如下所示。正在显示加载指示器,但加载页面后显示白色背景。如果我将 startInLoadingState 更改为 false,则显示 Web 内容但不显示加载指示器。它发生在 "react-native": "0.46.3" on ios
renderLoadingView() {
return (
<ActivityIndicator
animating = {this.state.visible}
color = '#bc2b78'
size = "large"
style = {styles.activityIndicator}
hidesWhenStopped={true}
/>
);
}
<WebView
source={source}
renderLoading={this.renderLoadingView} startInLoadingState={true} />
【问题讨论】:
-
如果您使用的是
ActivityIndicator,请不要在其中添加propanimating。这可能是原因,您的加载指示器一直在持续...... -
renderLoadingView() { return (
); } -
我没有使用道具
-
删除此
animating = {this.state.animating},它将按需要工作。
标签: react-native-ios