反应导航本机堆栈搜索栏占位符文本

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

我无法找到在reactnavigations本机堆栈搜索栏中更改占位符文本颜色的位置。

修改其他所有内容在这里都有很好的描述:

https://reactnavigation.org/docs/native-stack-navigator/

你有什么想法吗?

我正在使用:

    navigation.setOptions({
        headerSearchBarOptions: {
            placeholder: "placeholder",
            placement: "stacked",
            autofocus: true,
            hideWhenScrolling: false,
            onChangeText: (event) => setNeedle(event.nativeEvent.text),
            tintColor: "white",
            textColor: "white",
            obscureBackground:false
        },
    } as NativeStackNavigationOptions)
react-native react-navigation
1个回答
0
投票

尝试以下一个

navigation.setOptions({
    headerSearchBarOptions: {
        placeholder: "placeholder",
        placement: "stacked",
        autofocus: true,
        hideWhenScrolling: false,
        onChangeText: (event) => setNeedle(event.nativeEvent.text),
        tintColor: "white",
        textColor: "white",
        obscureBackground:false
        placeholder:"Search",
        placeholderTextColor:"red" // Your color
    },
} as NativeStackNavigationOptions)
© www.soinside.com 2019 - 2024. All rights reserved.