1. 程式人生 > >React native 的TextInput失去獲取焦點

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"
/>