1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import React, { useState } from 'react';
- import {View , Text, TextInput, Button,StyleSheet} from 'react-native';
- import { Icon } from 'react-native-elements'
- export default function Numbers(props) {
- let [number , setNumber] = useState(props.number || '')
- let title = props.title || "Input";
- return(
- <View style={styles.container}>
- <Text style={styles.title}>{title}</Text>
- <TextInput
-
-
- onChangeText={(number) => {
- try{
- number = parseInt(number);
- } catch(e) {
- return;
- }
- props.onChange && props.onChange(number);
- setNumber(number);
-
- }}
- keyboardType={'numeric'}
- value={number.toString()}
- style={[{outline:'none',background:"#FFFFFF"},styles.defaultInput]}
- />
- </View>
- )
- }
- /*
- width: 62px;
- height: 21px;
- background: #FFFFFF 0% 0% no-repeat padding-box;
- border-radius: 14px;
- opacity: 1;
- */
- const styles = StyleSheet.create({
- container:{
- padding:10,
- flex:1,
-
- opacity:1
- },
- defaultInput: {
- width:62,
- height:21,
- borderWidth:1,
- borderRadius:14,
-
- }
- })
|