Skip to content

Commit a83de15

Browse files
author
soliury
committed
change Keyboard use
1 parent e58b95c commit a83de15

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/layouts/Comment.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {Component} from 'react';
2-
import {View, StyleSheet, Text, Image, ListView, TouchableOpacity, TextInput, LayoutAnimation, Dimensions, DeviceEventEmitter, Platform} from 'react-native';
2+
import {View, StyleSheet, Text, Image, ListView, TouchableOpacity, TextInput, LayoutAnimation, Dimensions, Keyboard, Platform} from 'react-native';
33
import Icon from 'react-native-vector-icons/Ionicons';
44
import Nav from '../components/Nav';
55
import Spinner from '../components/base/Spinner';
@@ -22,12 +22,12 @@ class Comment extends Component {
2222
this.state = {
2323
didFocus: false
2424
};
25-
DeviceEventEmitter.addListener('keyboardWillShow', this.updateKeyboardSpace.bind(this));
26-
DeviceEventEmitter.addListener('keyboardWillHide', this.resetKeyboardSpace.bind(this));
25+
Keyboard.addListener('keyboardWillShow', this.updateKeyboardSpace.bind(this));
26+
Keyboard.addListener('keyboardWillHide', this.resetKeyboardSpace.bind(this));
2727

2828
if (Platform.OS === 'android') {
29-
DeviceEventEmitter.addListener('keyboardDidShow', this.updateKeyboardSpace.bind(this));
30-
DeviceEventEmitter.addListener('keyboardDidHide', this.resetKeyboardSpace.bind(this));
29+
Keyboard.addListener('keyboardDidShow', this.updateKeyboardSpace.bind(this));
30+
Keyboard.addListener('keyboardDidHide', this.resetKeyboardSpace.bind(this));
3131
}
3232
}
3333

0 commit comments

Comments
 (0)