【发布时间】:2019-11-22 10:44:51
【问题描述】:
我正在尝试制作一个 ScrollView,它会在一段时间内自动滚动到底部。但它会立即滚动到底部。
moveScreen = () =>{
this.scrollViewRef.flashScrollIndicators();
this.scrollViewRef.scrollToEnd({duration: 5000, animated: true});}
setScrollViewRef = (element) => {
this.scrollViewRef = element;};
render(){
return (
<View style={{height:'100%', width:'100%',flexDirection:'row'}}>
<ScrollView ref={this.setScrollViewRef} style={{height:'100%',width:'90%'}} onContentSizeChange={()=> this.moveScreen()}>
{balloonList}
</ScrollView>
<View style={{height:'100%',width:'10%',justifyContent:'flex-end',}}>{bucketList}</View>
</View>
);}
【问题讨论】:
标签: react-native react-native-android react-native-scrollview