Skip to content

Commit

Permalink
Update gif to match demo app, update demo to be more compelling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andr3wHur5t committed Oct 16, 2015
1 parent 1e213e0 commit 076fa9c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Plug and play iOS react-native keyboard spacer view.

![image](http://giant.gfycat.com/ThriftyCelebratedChital.gif)
![image](http://fat.gfycat.com/InconsequentialBothAmericankestrel.gif)
## Quick Start

Install View: `npm install --save react-native-keyboard-spacer`
Expand All @@ -19,17 +19,24 @@ var KeyboardSpacer = require('react-native-keyboard-spacer');
var {
AppRegistry,
StyleSheet,
Text,
Image,
View,
TextInput
} = React;

var DemoApp = React.createClass({
render: function() {
return (
<View style={[{backgroundColor: 'green', flex: 1}]}>
<TextInput style={{backgroundColor: 'yellow', flex: 1}}/>
<View style={{backgroundColor: 'red', left: 0, right: 0, height: 5}}/>
<View style={[{flex: 1}]}>
{/* Some random image to show scaling */}
<Image source={{uri: 'http://img11.deviantart.net/072b/i/2011/206/7/0/the_ocean_cherry_tree_by_tomcadogan-d41nzsz.png', static: true}}
style={{flex: 1}}/>

{/* The text input to put on top of the keyboard */}
<TextInput style={{left: 0, right: 0, height: 45}}
placeholder={'Enter your text!'}/>

{/* The view that will animate to match the keyboards height */}
<KeyboardSpacer/>
</View>
);
Expand All @@ -38,4 +45,3 @@ var DemoApp = React.createClass({

AppRegistry.registerComponent('DemoApp', () => DemoApp);
```

0 comments on commit 076fa9c

Please sign in to comment.