fixed the keyboard scroll issue on android

This commit is contained in:
Sadaqat Ali 2022-02-13 23:22:09 +05:00
parent 5c98ba9fb6
commit 5b80af3904
3 changed files with 31 additions and 11 deletions

View File

@ -13,7 +13,7 @@ export default EStyleSheet.create({
},
shadowColor: '#5f5f5fbf',
shadowOpacity: 0.1,
elevation: 3,
// elevation: 3,
},
icon: {
alignSelf: 'center',

View File

@ -1,11 +1,12 @@
import React, { Component, Fragment } from 'react';
import { View, Text, FlatList, TouchableOpacity, Alert } from 'react-native';
import { View, Text, Platform, ScrollView, KeyboardAvoidingView } from 'react-native';
import { WebView } from 'react-native-webview';
import { injectIntl } from 'react-intl';
import Slider from '@esteemapp/react-native-slider';
import get from 'lodash/get';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import { View as AnimatedView } from 'react-native-animatable';
import { TouchableOpacity, FlatList } from 'react-native-gesture-handler';
// Constants
import { debounce } from 'lodash';
@ -477,17 +478,29 @@ class DelegateScreen extends Component {
return (
<Fragment>
<BasicHeader title={intl.formatMessage({ id: 'transfer.delegate' })} />
<KeyboardAwareScrollView
contentContainerStyle={styles.fillSpace}
extraScrollHeight={80}
{/* <KeyboardAwareScrollView
contentContainerStyle={{borderWidth:1,flexGrow:1}}
extraScrollHeight={150}
extraHeight={200}
keyboardShouldPersistTaps
enableOnAndroid={true}
enableAutomaticScroll={(Platform.OS === 'ios')}
> */}
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
style={styles.fillSpace}
keyboardShouldPersistTaps
>
<View style={styles.container}>
{step >= 1 && _renderStepOne()}
{step >= 2 && _renderStepTwo()}
{_renderMainBtn()}
</View>
</KeyboardAwareScrollView>
<ScrollView keyboardShouldPersistTaps contentContainerStyle={styles.grow}>
<View style={styles.container}>
{step >= 1 && _renderStepOne()}
{step >= 2 && _renderStepTwo()}
{_renderMainBtn()}
</View>
</ScrollView>
</KeyboardAvoidingView>
{/* </KeyboardAwareScrollView> */}
<OptionsModal
ref={this.startActionSheet}
options={[

View File

@ -206,6 +206,8 @@ export default EStyleSheet.create({
top: 40,
width: 172,
maxHeight: 250,
zIndex: 999999,
elevation: 3,
},
usersDropdown: {
borderColor: '$primaryWhiteLightBackground',
@ -213,6 +215,7 @@ export default EStyleSheet.create({
shadowOpacity: 0.3,
shadowColor: '$shadowColor',
backgroundColor: '$primaryLightBackground',
elevation: 3,
},
usersDropItemRow: {
height: 50,
@ -221,6 +224,7 @@ export default EStyleSheet.create({
alignItems: 'center',
paddingHorizontal: 10,
paddingVertical: 10,
elevation: 3,
},
usersDropItemRowText: {
color: '$primaryDarkGray',
@ -299,4 +303,7 @@ export default EStyleSheet.create({
fontWeight: '600',
textAlign: 'left',
},
grow: {
flexGrow: 1,
},
});