React Native TextInput 输入框赋值没反应

react

TextInput 输入框赋值没反应 

 

//RnEditText部分截图

 





//RnEditText源码


import React, {
Component,
PropTypes
} from 'react';

import {
View,
Text,
Image,
TextInput,
StyleSheet,
} from 'react-native';

import AutoUtil from '../utils/AutoUtil';


export default class RnEditText extends Component {
static propTypes = {
autoFocus: PropTypes.bool,
caretHidden: PropTypes.bool,
editable: PropTypes.bool,
keyboardType: PropTypes.string,
textAlign: PropTypes.string,
maxLength: PropTypes.number,
multiline: PropTypes.bool,
onBlur: PropTypes.func,
onChange: PropTypes.func,
onChangeText: PropTypes.func,
onEndEditing: PropTypes.func,
onFocus: PropTypes.func,
hint: PropTypes.string,
value: PropTypes.string,
secureTextEntry: PropTypes.bool,
outStyle: PropTypes.number,
textAlignVertical : PropTypes.string,
textAlign : PropTypes.string,
};


render() {
let Platform = require('Platform');
if (Platform.OS === 'android') {
return (
<TextInput
autoFocus={this.props.autoFocus}
caretHidden={this.props.caretHidden}
editable={this.props.editable}
keyboardType={this.props.keyboardType}
textAlign={this.props.textAlign}
maxLength={this.props.maxLength}
multiline={this.props.multiline}
onBlur={this.props.onBlur}
onChange={this.props.onChange}
onChangeText={this.props.onChangeText}
onEndEditing={this.props.onEndEditing}
onFocus={this.props.onFocus}
placeholder={this.props.hint}
placeholderTextColor={'#cccccc'}
value={this.props.value}
secureTextEntry={this.props.secureTextEntry}
underlineColorAndroid='transparent'
style={[this.props.outStyle, {padding: 0}]}
textAlignVertical = {this.props.textAlignVertical}
/>
);
} else {
return (
<TextInput
autoFocus={this.props.autoFocus}
caretHidden={this.props.caretHidden}
editable={this.props.editable}
keyboardType={this.props.keyboardType}
textAlign={this.props.textAlign}
maxLength={this.props.maxLength}
multiline={this.props.multiline}
onBlur={this.props.onBlur}
onChange={this.props.onChange}
onChangeText={this.props.onChangeText}
onEndEditing={this.props.onEndEditing}
onFocus={this.props.onFocus}
placeholder={this.props.hint}
placeholderTextColor={"#cccccc"}
value={this.props.value}
secureTextEntry={this.props.secureTextEntry}
style={this.props.outStyle}
/>
);
}
}

}

以上是 React Native TextInput 输入框赋值没反应 的全部内容, 来源链接: utcz.com/z/381916.html

回到顶部