改变堆栈导航器的头部高度

问题描述 投票:1回答:1

我一直在尝试改变我的堆栈导航头的高度。然而,什么都没有用!

<Stack.Navigator initialRouteName="LiveLandingScreen">
      <Stack.Screen name="LiveLandingScreen" component={LiveLandingScreen} />
      <Stack.Screen name="History" component={History} />
</Stack.Navigator>

代码工作正常,但有谁能帮助我改变头的高度,好吗?

谢谢

react-native react-navigation
1个回答
1
投票

你需要做的是这样做,如果我们假设你想改变历史的头条的高度,你会做 。

<Stack.Navigator initialRouteName="LiveLandingScreen">
      <Stack.Screen name="LiveLandingScreen" component={LiveLandingScreen} />
      <Stack.Screen name="History" component={History} option={{headerStyle: {height: 60}}} />.  ///ADD OPTION
</Stack.Navigator>

我希望它能帮助<3

© www.soinside.com 2019 - 2024. All rights reserved.