我使用Expo XDE(xde-2.19.3)创建了一个React Native项目,在屏幕上放置了一些。我使用KeyboardAwareScrollView来滚动输入内容以便在键盘下方查看,这在iOS上正常工作,但在Android上无法正常工作。希望这很清楚。
查看了KeyboardAwareScrollView文档,并且发现我需要配置AndroidManifest.xml,但看起来Expo已经解决了这个问题:https://github.com/expo/expo/blob/master/template-files/android/AndroidManifest.xml 然而,我仍然无法让它在Android上正常工作...
我可能漏掉了什么?
查看了KeyboardAwareScrollView文档,并且发现我需要配置AndroidManifest.xml,但看起来Expo已经解决了这个问题:https://github.com/expo/expo/blob/master/template-files/android/AndroidManifest.xml 然而,我仍然无法让它在Android上正常工作...
我可能漏掉了什么?
render() {
return (
<KeyboardAwareScrollView
enableOnAndroid='true'
enableAutoAutomaticScrol='true'
keyboardOpeningTime={0}
>
<ScrollView style={styles.container}>
<View style={styles.subcontainer}>
<View style={styles.form}>
<TextInput
ref='NoduleCountInput'
onFocus={() => this.onFocus()}
onBlur={() => this.onBlur()}
keyboardType='phone-pad'
returnKeyType='done'
placeholder='Test'
style={styles.field}
/>
<TextInput
ref='NoduleCountInput'
onFocus={() => this.onFocus()}
onBlur={() => this.onBlur()}
keyboardType='phone-pad'
returnKeyType='done'
placeholder='Test'
style={styles.field}
/>
<TextInput
ref='NoduleCountInput'
onFocus={() => this.onFocus()}
onBlur={() => this.onBlur()}
keyboardType='phone-pad'
returnKeyType='done'
placeholder='Test'
style={styles.field}
/>
<TextInput
ref='NoduleCountInput'
onFocus={() => this.onFocus()}
onBlur={() => this.onBlur()}
keyboardType='phone-pad'
returnKeyType='done'
placeholder='Test'
style={styles.field}
/>
<TextInput
ref='NoduleCountInput'
onFocus={() => this.onFocus()}
onBlur={() => this.onBlur()}
keyboardType='phone-pad'
returnKeyType='done'
placeholder='Test'
style={styles.field}
/>
<TextInput
ref='NoduleCountInput'
onFocus={() => this.onFocus()}
onBlur={() => this.onBlur()}
keyboardType='phone-pad'
returnKeyType='done'
placeholder='Test'
style={styles.field}
/>
<TextInput
ref='NoduleCountInput'
onFocus={() => this.onFocus()}
onBlur={() => this.onBlur()}
keyboardType='phone-pad'
returnKeyType='done'
placeholder='Test'
style={styles.field}
/>
</View>
</View>
</ScrollView>
</KeyboardAwareScrollView>
);
}
androidStatusBar
。 - arled