[英]Refresh Control not working with bottom tab navigator in react native
I have an app with three tabs!我有一个包含三个选项卡的应用程序! In the first tab which displays all my product i would like to be able to drag and refresh all products from database!
在显示我所有产品的第一个选项卡中,我希望能够从数据库中拖动并刷新所有产品!
I tried using the refresh control but it doesn't work.. It didn't even drag down!我尝试使用刷新控件但它不起作用..它甚至没有拖下来!
NOTE: In the tab I have a stack navigator with other screens i'm just trying to refresh the initial screen of the stack navigator in a Tab navigator in a stack navigator Stack Nav -> Tab Nav -> Stack Nav -> Products Screen
注意:在选项卡中,我有一个带有其他屏幕的堆栈导航器,我只是想在堆栈导航器
Stack Nav -> Tab Nav -> Stack Nav -> Products Screen
中的 Tab 导航器中刷新堆栈导航器的初始屏幕
<SafeAreaView style={{ flex: 1 }}>
<Header searchFunction={showSearch} />
{/* <Text style={GlobalStyles.title}>Home Screen</Text> */}
<ScrollView
style={GlobalStyles.container}
showsVerticalScrollIndicator={false}
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={() => {
console.log("Working");
}}
/>
}
>
...
</ScrollView>
</SafeAreaView>
container: {
flex: 1,
backgroundColor: color.light,
padding: 10,
},
It's hard to debug something like this without enough information, I would suggest that you remove everything else you have so you can figure out if the ScrollView is the one that's not working or the elements that you put inside of it.如果没有足够的信息,很难调试这样的东西,我建议您删除所有其他东西,这样您就可以确定 ScrollView 是不起作用的还是您放入其中的元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.