저는 React Native에서 레벨을 올리고 있으며 프로젝트를 진행 중입니다. 그래서 내부 화면에서 하단 탐색을 숨기고 싶습니다.
- Dashboard
--- home <- hide bottom navigation
--- moment <- hide bottom navigation
--- period <- hide bottom navigation
--- contact <- hide bottom navigation
- Calendar
- Notification
- User
tabBarVisible: false
대시 보드 화면 옵션을 사용해 보았지만 내부 화면 대신 대시 보드 화면의 하단 탐색을 숨 깁니다. 내부 화면에서 하단 탐색을 숨기는 가장 좋은 방법은 무엇입니까?
내 탐색 코드는 다음과 같습니다.
하단 탐색
const BottomNavigation = () => (
<Tab.Navigator tabBar={props => <MyTabBar {...props} />}>
<Tab.Screen
name={ScreenName.dashboard}
options={{tabBarLabel: 'Dashboard'}}
component={HomeNavigation}
/>
<Tab.Screen
name={ScreenName.calendar}
options={{
tabBarLabel: 'Calendar',
}}
component={Calendar}
/>
<Tab.Screen
name={ScreenName.notification}
options={{
tabBarLabel: 'Notification',
}}
component={Notification}
/>
<Tab.Screen
name={ScreenName.user}
options={{
tabBarLabel: 'User',
}}
component={User}
/>
</Tab.Navigator>
);
홈 내비게이션
const HomeNavigation = () => (
<Stack.Navigator
screenOptions={{
title: null,
headerStyle: {elevation: 0, shadowOpacity: 0},
}}>
<Stack.Screen
name={ScreenName.home}
component={Home}
options={() => ({
headerShown: false,
})}
/>
<Stack.Screen name={ScreenName.moment} component={Moment} />
<Stack.Screen name={ScreenName.period} component={Period} />
<Stack.Screen name={ScreenName.contact} component={Contact} />
</Stack.Navigator>
);
하단 탭 탐색기를 다른 방법 대신 스택 탐색기의 첫 번째 화면에 배치해야합니다.
- Home
--- Dashboard
--- Calendar
--- Notification
--- User
- Moment
- Period
- Contact
이렇게하면 새 화면을 푸시 할 때 하단 탭 표시 줄 위에 표시되고 탭 표시 줄이 표시되지 않습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다