$ npm install react-native-iqkeyboard-manager --save
$ react-native link react-native-iqkeyboard-manager
- In XCode, in the project navigator, right click
Libraries
➜Add Files to [your project's name]
- Go to
node_modules
➜react-native-iqkeyboard-manager
and addRNKeyboardmanager.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNKeyboardmanager.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
import RNKeyboardmanager from 'react-native-iqkeyboard-manager';
//enable keyboard manager
RNKeyboardmanager.enableWithOptions({
shouldResignOnTouchOutside: true,
keyboardDistanceFromTextField: 20,
preventShowingBottomBlankSpace: true,
enableAutoToolbar: true,
toolbarDoneBarButtonItemText: "Done",
toolbarManageBehaviour: 1, // 0,1, 2
shouldToolbarUsesTextFieldTintColor: true
})
//disable keybard manager
RNKeyboardmanager.disable();