React native 的TextInput失去获取焦点

<TextInput ref='first'
           underlineColorAndroid="transparent"
           autoFocus={firstFlag}    
           editable={firstFlag}
           keyboardType="numeric"
           maxLength={1}
           style={styles.inputItem}
           onChangeText={(text) => {
               this.refs.first.blur();//失去焦点
               this.refs.second.focus();//获取焦点
           }}
/>
<TextInput ref='second'
           autoFocus={secondFlag}
           editable={secondFlag}
           keyboardType="numeric"
/>

猜你喜欢

转载自blog.csdn.net/LoveEate/article/details/83305743