我想创建一个登录表单像下面上反应母语:React-Native带边框的文本输入?
我无法创建一个表单/的TextInput与固体边界(不用担心其他的CSS样式,我只需要得到固体边界)
进口:
import { View, Text, TextInput } from 'react-native';
import { FormLabel, FormInput } from 'react-native-elements';
import { Container, Header, Content, Form, Item, Input, Label, Button } from 'native-base';
这是风格:
const styles = {
container: {
width: '100%',
height: '100%',
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
},
loginSquare: {
backgroundColor: '#FFFFFF',
height: 300,
width: 300,
display: 'flex',
justifyContent: 'flex-start',
alignItems: 'center'
},
loginHeader: {
backgroundColor: '#660008',
width: '100%',
height: 75
},
loginText: {
color: '#FFFFFF'
},
loginForm: {
width: 250,
height: 50
},
loginButton: {
backgroundColor: '#660008'
},
loginForm: {
height: 75,
marginLeft: 25,
marginRight: 25,
borderColor: 'gray'
}
}
和代码:
使用RN的TextInput
分量+纯CSS我尝试上面的代码示例
render(){
return (
<View style={styles.container}>
<View style={styles.loginSquare}>
<View style={styles.loginHeader}>
<Text style={styles.loginText}>Login</Text>
</View>
<View style={styles.loginForm}>
<TextInput
style={{height: 75}}
placeholder="Email"
/>
</View>
<View style={styles.loginForm}>
<TextInput
style={{height: 75}}
placeholder="Password"
/>
</View>
<View>
<Button block style={styles.loginButton}>
<Text style={styles.loginText}>Sign In</Text>
</Button>
</View>
</View>
</View>
。我还期待着在NativeBase和RNElements(RNElements形式的API:here,NativeBase形成API:here),但RN元素没有提及文本输入+边境什么,而天然碱基提到这个问题,我试过了,没有成功:
<Form bordered>
<Item>
<Input placeholder="Username" />
</Item>
</Form>
什么是我可以创建像第一个截图边界输入的一种方法?
给你的文本输入柔性:1和边框宽度和颜色,以你的登录表单样式 – eden