我在React Native应用程序中有两个屏幕,称为屏幕A和屏幕B。屏幕A中有一个文本输入框。我为此设置了自动聚焦并且最初它可以正常工作。
当我们从屏幕A导航到屏幕B,然后再从B->A导航回来时,文本输入框的自动聚焦功能无法正常工作。
是否有人有解决方法?
<TextInput
style={styles.textInput}
textStyle={styles.inputTextStyle}
autoFocus={true}
placeholder='Enter Code'
keyboard={'numeric'}
placeholderTextColor={AppStyles.color.grey}
value={code}
onChangeText={this.updateCode}
underline={false}
/>