-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
KeyboardAwareScrollView
that covers entire screen
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { useState } from "react"; | ||
import { KeyboardAwareScrollView } from "react-native-keyboard-controller"; | ||
|
||
import TextInput from "../../../components/TextInput"; | ||
|
||
import { styles } from "./styles"; | ||
|
||
const BIG_TEXT = `Where does it come from? | ||
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. | ||
Check failure on line 9 in example/src/screens/Examples/AwareScrollViewEntireScreen/index.tsx GitHub Actions / 🔍 spellcheck
Check failure on line 9 in example/src/screens/Examples/AwareScrollViewEntireScreen/index.tsx GitHub Actions / 🔍 spellcheck
Check failure on line 9 in example/src/screens/Examples/AwareScrollViewEntireScreen/index.tsx GitHub Actions / 🔍 spellcheck
Check failure on line 9 in example/src/screens/Examples/AwareScrollViewEntireScreen/index.tsx GitHub Actions / 🔍 spellcheck
Check failure on line 9 in example/src/screens/Examples/AwareScrollViewEntireScreen/index.tsx GitHub Actions / 🔍 spellcheck
|
||
s | ||
s | ||
s | ||
Where does it come from? | ||
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32. | ||
Check failure on line 16 in example/src/screens/Examples/AwareScrollViewEntireScreen/index.tsx GitHub Actions / 🔍 spellcheck
Check failure on line 16 in example/src/screens/Examples/AwareScrollViewEntireScreen/index.tsx GitHub Actions / 🔍 spellcheck
Check failure on line 16 in example/src/screens/Examples/AwareScrollViewEntireScreen/index.tsx GitHub Actions / 🔍 spellcheck
|
||
s | ||
s | ||
s | ||
Where does it come from? | ||
Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.`; | ||
|
||
export default function AwareScrollView() { | ||
const [_, setText] = useState(""); | ||
|
||
return ( | ||
<> | ||
<KeyboardAwareScrollView | ||
bottomOffset={50} | ||
contentContainerStyle={styles.content} | ||
style={styles.container} | ||
testID="aware_scroll_view_container" | ||
> | ||
<TextInput | ||
defaultValue={BIG_TEXT} | ||
style={styles.input} | ||
onChangeText={setText} | ||
/> | ||
</KeyboardAwareScrollView> | ||
</> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { StyleSheet } from "react-native"; | ||
|
||
export const styles = StyleSheet.create({ | ||
container: { | ||
paddingHorizontal: 16, | ||
}, | ||
content: { | ||
paddingTop: 50, | ||
}, | ||
input: { | ||
width: "100%", | ||
borderWidth: 2, | ||
borderColor: "black", | ||
borderRadius: 8, | ||
paddingHorizontal: 12, | ||
}, | ||
}); |