Я написал небольшой кусочек кода. Вы можете попробовать этот код. Это может решить вашу проблему. Пожалуйста, также проверьте этот код на закуску и сразу же отсканируйте QR с помощью приложения Expo. Пожалуйста, с
import * as React from 'react';
import { TextInput, Text, View, StyleSheet } from 'react-native';
import { Constants } from 'expo';
export default class App extends React.Component {
render() {
return (
<View style={styles.container}>
<View
style={{
justifyContent: 'center',
alignSelf: 'center',
alignItems: 'center',
alignContent: 'center',
flexDirection: 'row',
}}>
<Text style={{ textAlign: 'center', flex: 1, padding: 15 }}>
{'Full name'}
</Text>
<TextInput
placeholder='Enter Your Full Name'
placeholderTextColor='#303030'
style={{
borderWidth: 1,
borderColor: '#000',
flex: 1,
padding: 15,
}}/>
</View>
<View
style={{
justifyContent: 'center',
alignSelf: 'center',
alignItems: 'center',
alignContent: 'center',
flexDirection: 'row',
}}>
<Text style={{ textAlign: 'center', flex: 1, padding: 15 }}>
{'CRP Number'}
</Text>
<TextInput
placeholder='Enter Your CRP Number'
placeholderTextColor='#303030'
style={{
borderWidth: 1,
borderColor: '#000',
flex: 1,
padding: 15,
}}/>
</View>
<View
style={{
justifyContent: 'center',
alignSelf: 'center',
alignItems: 'center',
alignContent: 'center',
flexDirection: 'row',
}}>
<Text style={{ textAlign: 'center', flex: 1, padding: 15 }}>
{'Company Name'}
</Text>
<TextInput
placeholder='Enter Your Company Name'
placeholderTextColor='#303030'
style={{
borderWidth: 1,
borderColor: '#000',
flex: 1,
padding: 15,
}}/>
</View>
<View
style={{
justifyContent: 'center',
alignSelf: 'center',
alignItems: 'center',
alignContent: 'center',
flexDirection: 'row',
}}>
<Text style={{ textAlign: 'center', flex: 1, padding: 15 }}>
{'Company CVR '}
</Text>
<TextInput
placeholder='Enter Your company CVR'
placeholderTextColor='#303030'
style={{
borderWidth: 1,
borderColor: '#000',
flex: 1,
padding: 15,
}}>
{'Enter Your company CVR'}
</TextInput>
</View>
<Text style={{ color:'#fff',borderRadius:50, width:300, height:50, textAlign:'center', padding:15, marginTop:70,backgroundColor:'#00b5ec'}}>{"Click to sign in"}</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
paddingTop: Constants.statusBarHeight,
backgroundColor: '#ecf0f1',
marginTop: 10,
marginRight:1
},
});
Обновленный ответ Пожалуйста, проверьте
import * as React from 'react';
import { FlatList, TextInput, Text, View, StyleSheet } from 'react-native';
import { Constants } from 'expo';
// You can import from local files
import AssetExample from './components/AssetExample';
// or any pure javascript modules available in npm
import { Card } from 'react-native-paper';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
jsonData: [
{ id: 1, textName: 'Hello', textInputName: 'Full Name' },
{
id: 2,
textName: 'Hello',
textInputName: 'Last Name',
},
{
id: 3,
textName: 'Hello',
textInputName: 'Date of Birth',
},
{
id: 4,
textName: 'Hello',
textInputName: 'Address',
},
{ id: 1, textName: 'Hello', textInputName: 'Full Name' },
{
id: 2,
textName: 'Hello',
textInputName: 'Last Name',
},
{
id: 3,
textName: 'Hello',
textInputName: 'Date of Birth',
},
{
id: 4,
textName: 'Hello',
textInputName: 'Address',
},
{ id: 1, textName: 'Hello', textInputName: 'Full Name' },
{
id: 2,
textName: 'Hello',
textInputName: 'Last Name',
},
{
id: 3,
textName: 'Hello',
textInputName: 'Date of Birth',
},
{
id: 4,
textName: 'Hello',
textInputName: 'Address',
},
],
};
}
render() {
return (
<View style={styles.container}>
<FlatList
style={{ width: '100%', flex: 1 }}
data={this.state.jsonData}
showsVerticalScrollIndicator={false}
renderItem={({ item }) => (
<View
style={{
justifyContent: 'center',
alignSelf: 'center',
alignItems: 'center',
alignContent: 'center',
flexDirection: 'row',
}}>
<Text style={{ textAlign: 'center', flex: 1, padding: 15 }}>
{item.textName}
</Text>
<TextInput
placeholder={item.textInputName}
placeholderTextColor="#303030"
style={{
borderWidth: 1,
borderColor: '#000',
flex: 1,
padding: 15,
}}
/>
</View>
)}
/>
<Text
style={{
color: '#fff',
borderRadius: 50,
width: 300,
height: 50,
textAlign: 'center',
padding: 15,
marginTop: 10,
backgroundColor: '#00b5ec',
marginBottom: 20,
}}>
{'Click to sign in'}
</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
paddingTop: Constants.statusBarHeight,
marginTop: 10,
marginRight: 1,
},
});
Я также добавил обновленную закусочную выставку, пожалуйста, проверьте
https://snack.expo.io/@vishal7008/anxious-candy