当前位置: 移动技术网 > IT编程>网页制作>CSS > React Native TextInput 输入框赋值没反应解决

React Native TextInput 输入框赋值没反应解决

2019年06月02日  | 移动技术网IT编程  | 我要评论

生锈的吉他,鲍源源,家风家训小故事

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 (
                
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 (
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} /> ); } } }

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网