【发布时间】:2016-05-25 00:57:43
【问题描述】:
使用 React 本机 0.26,
我的组件是这样的
const Search = () => {
return (
<View style={styles.backgroundImage}>
<TextInput style={styles.textInput} onChangeText={(text) => console.log(text)} placeholder={"Enter Search Term"}/>
</View>
)
}
还有我的风格:
const styles = StyleSheet.create({
backgroundImage: {
flex : 1,
flexDirection: "column",
justifyContent: 'center',
alignItems: 'center'
},
textInput: {
justifyContent: "center",
alignItems: "stretch",
borderRightWidth: 30,
borderLeftWidth: 30,
height: 50,
borderColor: "#FFFFFF",
}
})
我面临的问题是
- 边框右宽和左宽似乎没有任何效果,占位符文本只是从左边缘开始。
- TextInput 的背景为“灰色”,与视图的背景相同。我希望它默认为白色,(感觉透明)。
- 用 iOS 模拟器如何调出键盘,我想设置
returnKeyType看看键盘的样子(并在onSubmitEditing上有一些代码并测试)。
【问题讨论】:
标签: react-native react-native-text