I have a react-native component which has a TextInput. On android, the placeholder shows up with no problem, however, on IOS, it does not show up. Below I have attached a picture of the problem, as well as the code for the text input.
IOS TextInput Not showing placeholder
<TextInput
style={{
backgroundColor:"white",
height: 40,
margin: 12,
borderWidth: 1,
borderBottomColor: '#ffffff',
borderTopColor: '#ffffff',
borderRightColor: '#ffffff',
borderLeftColor: '#ffffff',
padding: 10,
borderColor: "#ffffff",
width:"70%",
position:"absolute",
top:80,
borderRadius:10
}}
placeholder="Search"
onChangeText={txtHandler}
defaultValue={text}
></TextInput>
发现它出现了,我需要将此属性添加到 TextInput:
placeholderTextColor="black"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.