如何在顶端导航器中显示标签 BarBadge
作者: gayathrithedev创建于 2020年8月19日更新于 2026年9月13日
标签bugpackage:material-top-tabsfeature-request
Current Behavior
- 我正在使用材料顶部标签导航器
const TopTabNav = ({ route }) => {
const {
notifications
} = route.params;
return (
<NetworkContext.Provider value={route.params}>
<TopTab.Navigator>
<TopTab.Screen
name="Home"
component={Home}
/>
<TopTab.Screen
name="Settings"
component={Settings}
options={{
tabBarBadge: notifications.length,
}}
/>
</TopTab.Navigator>
</NetworkContext.Provider>
);
};- 在材料底部标签导航器中,有一个名为 tabBarBadge 的属性。这样就很容易显示标记/通知数量。
- 但在材料顶部导航器中,当我应用相同的内容时…它没有按照预期显示标记数量
内容来源: react-navigation/react-navigation