diff --git a/packages/react-navigation/examples/NavigationPlayground/js/App.js b/packages/react-navigation/examples/NavigationPlayground/js/App.js index a5abafca..c091ca6c 100644 --- a/packages/react-navigation/examples/NavigationPlayground/js/App.js +++ b/packages/react-navigation/examples/NavigationPlayground/js/App.js @@ -34,6 +34,7 @@ import StackWithTranslucentHeader from './StackWithTranslucentHeader'; import SimpleTabs from './SimpleTabs'; import SwitchWithStacks from './SwitchWithStacks'; import TabsWithNavigationFocus from './TabsWithNavigationFocus'; +import KeyboardHandlingExample from './KeyboardHandlingExample'; const ExampleInfo = { SimpleStack: { @@ -114,6 +115,11 @@ const ExampleInfo = { name: 'withNavigationFocus', description: 'Receive the focus prop to know when a screen is focused', }, + KeyboardHandlingExample: { + name: 'Keyboard Handling Example', + description: + 'Demo automatic handling of keyboard showing/hiding inside StackNavigator', + }, }; const ExampleRoutes = { @@ -143,6 +149,7 @@ const ExampleRoutes = { path: 'settings', }, TabsWithNavigationFocus, + KeyboardHandlingExample, }; type State = { diff --git a/packages/react-navigation/examples/NavigationPlayground/js/KeyboardHandlingExample.js b/packages/react-navigation/examples/NavigationPlayground/js/KeyboardHandlingExample.js new file mode 100644 index 00000000..7a0674a5 --- /dev/null +++ b/packages/react-navigation/examples/NavigationPlayground/js/KeyboardHandlingExample.js @@ -0,0 +1,62 @@ +import React from 'react'; +import { StatusBar, View, TextInput, InteractionManager } from 'react-native'; +import { createStackNavigator, withNavigationFocus } from 'react-navigation'; +import { Button } from './commonComponents/ButtonWithMargin'; + +class ScreenOne extends React.Component { + static navigationOptions = { + title: 'Home', + }; + + render() { + const { navigation } = this.props; + return ( + +