我无法找到在reactnavigations本机堆栈搜索栏中更改占位符文本颜色的位置。
修改其他所有内容在这里都有很好的描述:
你有什么想法吗?
我正在使用:
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)
尝试以下一个
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)