Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/keyboardavoidingview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ id: keyboardavoidingview
title: KeyboardAvoidingView
---

It is a component to solve the common problem of views that need to move out of the way of the virtual keyboard. It can automatically adjust either its height, position, or bottom padding based on the position of the keyboard.
It is a component to solve the common problem of views that need to move out of the way of the virtual keyboard. It can automatically adjust either its height, position, or bottom padding based on the keyboard height.

## Example

```SnackPlayer name=KeyboardAvoidingView&supportedPlatforms=android,ios
import React, { Component } from 'react';
import { View, KeyboardAvoidingView, TextInput, StyleSheet, Text, Platform, TouchableWithoutFeedback, Button, Keyboard } from 'react-native';

const keyBoardAvoidingComponent = () => {
const KeyboardAvoidingComponent = () => {
return (
<KeyboardAvoidingView
behavior={Platform.Os == "ios" ? "padding" : "height"}
behavior={Platform.OS == "ios" ? "padding" : "height"}
style={styles.container}
>
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
Expand Down Expand Up @@ -55,7 +55,7 @@ const styles = StyleSheet.create({
}
});

export default keyBoardAvoidingComponent;
export default KeyboardAvoidingComponent;
```

---
Expand Down