Doesn't work on Android
Hi guys, im running on Expo and doesn't work on android (running the last version of expo with react native 49), here the code:
import React, { Component } from 'react';
import {
StyleSheet,
Text,
TextInput,
} from 'react-native';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
export default class App extends Component {
render() {
return (
<KeyboardAwareScrollView enableOnAndroid>
<TextInput style={styles.textInput} placeholder={'First Name'} ref={(r) => { this._firstNameTI = r; }} returnKeyType={'next'}
underlineColorAndroid="transparent" onSubmitEditing={(event) => this._lastNameTI.focus()}/>
<TextInput style={styles.textInput} placeholder={'Last Name'} ref={(r) => { this._lastNameTI = r; }} returnKeyType={'next'}
underlineColorAndroid="transparent" onSubmitEditing={(event) => this._countryTI.focus()}/>
<TextInput style={styles.textInput} placeholder={'Country'} ref={(r) => { this._countryTI = r; }} returnKeyType={'next'}
underlineColorAndroid="transparent" onSubmitEditing={(event) => this._stateTI.focus()}/>
<TextInput style={styles.textInput} placeholder={'State'} ref={(r) => { this._stateTI = r; }} returnKeyType={'next'}
underlineColorAndroid="transparent" onSubmitEditing={(event) => this._addrTI.focus()}/>
<TextInput style={styles.textInput} placeholder={'Address'} ref={(r) => { this._addrTI = r; }} returnKeyType={'next'}
underlineColorAndroid="transparent" onSubmitEditing={(event) => this._emailTI.focus()}/>
<TextInput style={styles.textInput} keyboardType="email-address" placeholder={'Email'} ref={(r) => { this._emailTI = r; }}
underlineColorAndroid="transparent" returnKeyType={'next'} onSubmitEditing={(event) => this._msgTI.focus()}/>
<TextInput style={styles.textInput} placeholder={'Message'} ref={(r) => { this._msgTI = r; }} returnKeyType={'next'}
underlineColorAndroid="transparent" onSubmitEditing={(event) => this._notesTI.focus()}/>
<TextInput style={styles.textInput} placeholder={'Notes'} ref={(r) => { this._notesTI = r; }} returnKeyType={'go'}
underlineColorAndroid="transparent" />
</KeyboardAwareScrollView>
);
}
}
const styles = StyleSheet.create({
mainTitle: {
fontSize: 20,
marginTop: 10,
textAlign: 'center'
},
textInput: {
height: 60,
borderColor: 'gray',
borderWidth: 1,
marginBottom: 16,
// paddingVertical: 4,
// paddingHorizontal: 8,
},
});

Thanks !!!
Android Support may not work with Expo. Check #190
To use Android Support you need to set windowSoftInputMode to adjustPan which you can't do on Expo projects.
Yup @Swordsman-Inaction you are right expo apps use windowSoftInputMode with adjustResize any plan to support alternative way that works with adjustResize?
https://github.com/expo/expo/blob/master/exponent-view-template/android/app/src/main/AndroidManifest.xml#L14
@outaTiME Sorry, currently I'm don't have much time to work on this. But you are welcome to send a PR.
@outaTiME i found the same problem... @Swordsman-Inaction thanks for the info :) Expo confirmed indeed that it's adjustResize. One suggestion might be to update the docs of this repo so it's a bit clearer that the actual setting for windowSoftInputMode is adjustPan? And also potentially that it currently can't be used with Expo?
I'd gladly take a look at making a PR. any pointers on where to look first?
@outaTiME have you tried adding extraScrollHeight={100}? I'm using both android and expo and it works fine for me like this
<KeyboardAwareScrollView extraScrollHeight={100} enableOnAndroid={true} keyboardShouldPersistTaps='handled'>
Not working on XT890 (Kitkat) - Tested in Genymotion. Just IOS works. Expo* "sdkVersion": "26.0.0"
<KeyboardAwareScrollView
// resetScrollToCoords={{ x: 0, y: 0 }}
contentContainerStyle={styles.contentContainerStyler}
// scrollEnabled={true}
extraScrollHeight={100}
enableOnAndroid={true}
keyboardShouldPersistTaps="handled">
@MichelDiz might be a problem with your styles sheet. Can you try sharing that too?
I think it's far more likely that the problem is in react-native-onboarding-swiper. I'm using it to create a simple form in steps. But the interesting thing is that all "KeyboardAware" I tested worked on IOS. Only on Android that does not work.
Please, read the thread. Android support comes from windowSoftInputMode, it's not the same behaviour as iOS.
Well, even the Expo "Keyboard Aware" worked on Android. So, my problem must be something with react-native-onboarding-swiper.
@Spoof14 I've been dealing with this issue for HOURS, thank you so much!
It doesn't work for components that have position: 'absolute' in their style, better prepare the UI with relative positioning.
Unable to make any events. Getting offset error in android emulator. Any solution for this?
for me I was facing this issue on Android (react-native 0.62.2). iOS was working perfectly. I found that adjustResize flag in Android manifest was the culprit. I removed it and it started working
Before
android:windowSoftInputMode="stateAlwaysHidden|adjustPan|adjustResize"
After
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
Warning
I don't know what side effects it will cause in future.