gpt4 book ai didi

react-native - 如何制作可滚动的顶部选项卡导航器(React Navigation v6)

转载 作者:行者123 更新时间:2023-12-04 14:51:58 25 4
gpt4 key购买 nike

我正在使用 react navigation v6 .我想要的是顶部标签导航器中的可滚动标签?在第 3 方模块中,有很多问题,这就是我目前不使用它的原因。
enter image description here

最佳答案

用这个。 "@react-navigation/material-top-tabs";图书馆,这里是例子

import React from "react";
import { screens } from "../../constants";
import { createMaterialTopTabNavigator } from "@react-navigation/material-top-tabs";
import Booking from "./components/Booking";
import Payments from "./components/Payments";
import Cancellations from "./components/Cancellations";
import Refunds from "./components/Refunds";
import Instructorquestion from "./components/Instructorquestion";

const Tab = createMaterialTopTabNavigator();
const Faq = () => {
return (
<Tab.Navigator

screenOptions={{ tabBarScrollEnabled: true,tabBarIndicatorStyle:{
backgroundColor:"blue",
height:8,

} }}
sceneContainerStyle={{ backgroundColor: "white" }}

>
<Tab.Screen name={screens.BOOKINGS} component={Booking} />
<Tab.Screen name={screens.PAYMENTS} component={Payments} />
<Tab.Screen name={screens.CANCELLATIONS} component={Cancellations} />
<Tab.Screen name={screens.REFUNDS} component={Refunds} />
<Tab.Screen name={screens.INSTUCTORQUESTION} component={Instructorquestion} options={{ tabBarLabel: 'Instructor Questions' }} />

</Tab.Navigator>
);
};

export default Faq;

关于react-native - 如何制作可滚动的顶部选项卡导航器(React Navigation v6),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68932204/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com