React Native TextInput 输入框赋值没反应解决
程序员文章站
2022-08-14 22:47:02
textinput 输入框赋值没反应
//rnedittext部分截图
//rnedittext源码
import 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 (
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} /> ); } } }
下一篇: Ubuntu 下安装和配置 FTP服务器
推荐阅读
-
解决react-native软键盘弹出挡住输入框的问题
-
React Native TextInput 输入框赋值没反应解决
-
React Native 使用try catch解决TextInput输入的时候中文状态下崩溃的原因
-
【React-native】React-native键盘遮挡TextInput,使用 KeyboardAvoidingView 解决
-
react native 解决键盘弹起遮挡输入框问题
-
解决react-native软键盘弹出挡住输入框的问题
-
React Native TextInput 输入框赋值没反应解决
-
解决react-native软键盘弹出挡住输入框的问题
-
React Native入门(五)之使用输入框TextInput,按钮Button搭建登录界面