added keyboard avoiding view

This commit is contained in:
Sadaqat Ali 2022-04-19 10:11:53 +05:00
parent 000a0af461
commit af15c488cc
2 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/* eslint-disable react/no-unused-state */ /* eslint-disable react/no-unused-state */
import React, { Fragment, Component } from 'react'; import React, { Fragment, Component } from 'react';
import { Text, View, ScrollView, Alert } from 'react-native'; import { Text, View, ScrollView, Alert, KeyboardAvoidingView, Platform } from 'react-native';
import { injectIntl } from 'react-intl'; import { injectIntl } from 'react-intl';
import Slider from '@esteemapp/react-native-slider'; import Slider from '@esteemapp/react-native-slider';
import get from 'lodash/get'; import get from 'lodash/get';
@ -390,7 +390,11 @@ class PowerDownView extends Component {
return ( return (
<Fragment> <Fragment>
<BasicHeader title={intl.formatMessage({ id: `transfer.${transferType}` })} /> <BasicHeader title={intl.formatMessage({ id: `transfer.${transferType}` })} />
<View style={styles.container}> <KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
style={styles.powerDownKeyboadrAvoidingContainer}
keyboardShouldPersistTaps
>
<ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContentContainer}> <ScrollView style={styles.scroll} contentContainerStyle={styles.scrollContentContainer}>
{this._renderBeneficiarySelectionContent()} {this._renderBeneficiarySelectionContent()}
{_renderMiddleContent()} {_renderMiddleContent()}
@ -496,7 +500,7 @@ class PowerDownView extends Component {
)} )}
</View> </View>
</ScrollView> </ScrollView>
</View> </KeyboardAvoidingView>
<OptionsModal <OptionsModal
ref={this.startActionSheet} ref={this.startActionSheet}
options={[ options={[

View File

@ -347,4 +347,8 @@ export default EStyleSheet.create({
textAlign: 'left', textAlign: 'left',
paddingLeft: 12, paddingLeft: 12,
}, },
powerDownKeyboadrAvoidingContainer: {
flex: 1,
backgroundColor: '$primaryBackgroundColor',
},
}); });