如果标题太长,React 导航 6 headerRight 会被截断

Cra*_*acs 6 react-native react-navigation react-navigation-v6

我将应用程序更新为 React Navigation 6。在所有屏幕中,我自定义了headerBackImage,并添加了一些headerRight文本。在React Navigation 5中,如果headerTitle太长,它会被直接截断,并在标题末尾添加...,如下所示:

在此输入图像描述

但在 React navigation 6 中,这个功能看起来发生了变化。我添加了一些背景颜色来向您展示标题的剪切:

在此输入图像描述

我看到了这个主题:React Native Navigation Header title too long, 最终溢出,但也许 V6 中添加了新的 props。

这是我的屏幕:

<ProfileStack.Screen
    options={({ navigation }: ScreenProps) => ({
        headerTitle: 'My header title is not truncated why ?',
        headerTitleStyle: {
            backgroundColor: EColors.rouge,
        },
        headerBackImage: () => (
            <BackButton />
        ),
        headerTitleAlign: 'center',
        headerBackTitle: ' ',
        headerRight: () => (
            <Text
                onPress={() => navigation.navigate('toOtherScreen')}
                style={{ marginRight: 20, backgroundColor: EColors.vert }}
            >
                Infos
            </Text>
        ),
    })}
    name="screenName"
    component={ComponentName}
/>
Run Code Online (Sandbox Code Playgroud)

有人在RN V6中遇到过这种情况吗?