react-navigation正在iOS模拟器上运行,但在iOS真实设备上面临导航问题

时间:2019-05-06 07:03:24

标签: ios react-native react-navigation react-navigation-stack react-navigation-drawer

反应-导航既适用于iOS和android模拟器,也适用于android real设备,但不适用于iOS real设备

我正在使用堆栈导航器,在内部导航器中使用抽屉式导航器和选项卡导航器,但是在运行项目时,该程序在iOS和android模拟器以及android real设备上运行,但在iOS real设备上无法运行

我正在使用“反应导航”:“ ^ 3.9.1”

const AppContainer = createAppContainer(AppSwitchNavigator)
const AppSwitchNavigator = createStackNavigator({ // here i am create stack navigator and inside stack navigator used drawer navigator for dashboard 

    welcome: {
        screen: WelcomeScreen,

    },
    dashboard: {
        screen: AppDrawerNavigator1, // here i am using drawer navigator with some navigation options
        navigationOptions: ({ navigation }) => {
            return {
                headerStyle: {
                    backgroundColor: '#26c281'
                },
                headerLeft: (
                    <Icon name="ios-menu" size={30} style={{
                        paddingLeft: 10
                    }} onPress={() => navigation.openDrawer()} />
                ),
            }
        }
    },
    searchproduct: {
        screen: SearchProduct
    },
    postanitem: {
        screen: PostAnItem
    },
    livechat: {
        screen: LiveChat
    },
    marketprice: {
        screen: MarketPrice
    },
    knowledgeresource: {
        screen: KnowledgeResource
    },
    registration: {
        screen: UserRegistration
    },
    postAnItemSubmit: {
        screen: PostAnItemSubmit
    },
    langset: {
        screen: LanguageSetting
    },
    ProductDisplay: {
        screen: ProductDisplay,
    },
},
    {
        defaultNavigationOptions: {
            headerStyle: {
                backgroundColor: '#26c281'
            }
        }
    }







const AppDrawerNavigator1 = createDrawerNavigator({
    drawerHome: {
        screen: dashboardStackNavigator,
        navigationOptions: {
            title: 'Home',

            drawerIcon: ({ tintColor }) => (<Icon name='ios-home' size={30}
                style={{ color: tintColor }} />)
        }
    },
    drawerDashboard: {
        screen: Dashboard,
        navigationOptions: {
            title: 'Dashboard',
            headerStyle: null,
            drawerIcon: ({ tintColor }) => (<Icon name='ios-keypad' size={30}
                style={{ color: tintColor }} />)
        }
    },
    drawerSearchproduct: {
        screen: SearchProduct,
        navigationOptions: {
            title: 'Search Products',
            drawerIcon: ({ tintColor }) => (<Icon name='ios-search' size={30}
                style={{ color: tintColor }} />)
        }
    },
    drawerPostAnItem: {
        screen: PostAnItem,
        navigationOptions: {
            title: 'post an item',
            drawerIcon: ({ tintColor }) => (<Icon name='ios-add-circle' size=
                {30} style={{ color: tintColor }} />)
        }
    },

    drawerMarketPrice: {
        screen: MarketPrice,
        navigationOptions: {
            title: 'Market Price',
            drawerIcon: ({ tintColor }) => (<Icon name='ios-stats' size={30}
                style={{ color: tintColor }} />)
        }
    },
    drawerKnowledgeResource: {
        screen: KnowledgeResource,
        navigationOptions: {
            title: 'Knowledge Resources',
            drawerIcon: ({ tintColor }) => (<Icon name='ios-book' size={30}
                style={{ color: tintColor }} />)
        }
    },
    myproducts: {
        screen: MyProducts,
        navigationOptions: {
            title: 'My Products',
            drawerIcon: ({ tintColor }) => (<Icon name='ios-basket' size={30}
                style={{ color: tintColor }} />)
        }
    },

    languagesetting: {
        screen: LanguageSetting,
        navigationOptions: {
            title: 'Language Setting',
            drawerIcon: ({ tintColor }) => (<Icon name='ios-globe' size={30}
                style={{ color: tintColor }} />)
        }
    },

    drawerlogin: {
        screen: Login,
        navigationOptions: {
            title: 'Login',
            drawerIcon: ({ tintColor }) => (<Icon name='ios-log-in' size={30}
                style={{ color: tintColor }} />)
        }
    },
    drawerRegistration: {
        screen: UserRegistration,

        navigationOptions: {
            drawerLabel: () => null,
        }
    },

})







const dashboardStackNavigator = createStackNavigator({
    dashboardTabNavigator: dashboardTabNavigator
},
    {
        defaultNavigationOptions: ({ navigation }) => {

            return {
                header: null
            }
        }
    })




const dashboardTabNavigator = createMaterialTopTabNavigator({ //using tab navigator inside drawer navigator
    itemsell: {
        screen: ItemListSell,
        navigationOptions: {
            title: 'item list sell'
        }
    },
    itembuy: {
        screen: ItemListBuy,
        navigationOptions: {
            title: 'item list buy'
        }
    }
},
    {
        tabBarOptions: {
            style: {
                backgroundColor: '#26c281'
            }
        }
    })

0 个答案:

没有答案