简体   繁体   English

刷新控件不适用于本机反应中的底部选项卡导航器

[英]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 导航器中刷新堆栈导航器的初始屏幕

My code我的代码

The Scroll View:滚动视图:

<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>

GlobalStyles.container: GlobalStyles.容器:

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.

相关问题 在 React native 中创建自定义底部选项卡导航器 - Create custom bottom tab navigator in React native 在 React Native 中从底部选项卡导航器的标题导航 - Navigation from the header of the bottom tab navigator in react native React Native:底部标签按下不起作用 - React Native: bottom tab press not working 带有选项卡导航器的堆栈导航器(React Native) - Stack Navigator with Tab Navigator (React Native) 堆栈导航器和选项卡导航器无法响应本机问题 - Trouble with stack navigator and tab navigator for react native 嵌套在堆栈导航器中的 React Native 选项卡导航器 - React Native tab navigator nested in stack navigator React native MaterialCommunityIcons 在 Top Tab Navigator Version 5 中不起作用 - React native MaterialCommunityIcons not working in Top Tab Navigator Version 5 如何在导航到屏幕之前使用密码身份验证并使用 React Native 中的底部选项卡导航器对其进行调整? - How to use password authentication before navigate to screens and adapt it with the bottom tab navigator in React Native? 需要在 React Native 的 Bottom Tab Navigator 中访问 state 来实现 Cart Badge - Need access to state in Bottom Tab Navigator in React Native to implement Cart Badge 在反应原生的底部选项卡导航器中更改屏幕时如何更改图标和文本的颜色? - How to change color of icon as well as text when changing screen in bottom tab navigator in react native?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM