Skip to content

Commit a9ffd37

Browse files
authored
fix: Add ScrollView adjustment automatic (#43)
1 parent 1149e17 commit a9ffd37

File tree

5 files changed

+18
-1
lines changed

5 files changed

+18
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,16 @@ export default function ThreeTabs() {
197197
}
198198
```
199199

200+
### ScrollView
201+
202+
If you expirence issues with ScrollView content being below the tab bar, add `contentInsetAdjustmentBehavior="automatic"` to the ScrollView component.
203+
204+
205+
```tsx
206+
<ScrollView contentInsetAdjustmentBehavior="automatic">
207+
{/* content */}
208+
</ScrollView>
209+
```
200210

201211
## Contributing
202212

example/src/Screens/Albums.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ export function Albums(props: Partial<ScrollViewProps>) {
4242
const itemSize = dimensions.width / Math.floor(dimensions.width / 150);
4343

4444
return (
45-
<ScrollView contentContainerStyle={styles.content} {...props}>
45+
<ScrollView
46+
contentContainerStyle={styles.content}
47+
contentInsetAdjustmentBehavior="automatic"
48+
{...props}
49+
>
4650
{COVERS.map((source, i) => (
4751
<View
4852
key={i}

example/src/Screens/Article.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export function Article({
5353
ref={ref}
5454
style={{ backgroundColor: '#fff' }}
5555
contentContainerStyle={styles.content}
56+
contentInsetAdjustmentBehavior="automatic"
5657
{...rest}
5758
>
5859
<View style={styles.author}>

example/src/Screens/Chat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export function Chat({
2828
style={styles.container}
2929
>
3030
<ScrollView
31+
contentInsetAdjustmentBehavior="automatic"
3132
style={styles.inverted}
3233
contentContainerStyle={styles.content}
3334
{...rest}

example/src/Screens/Contacts.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ export function Contacts({ query, ...rest }: Props) {
9999
return (
100100
<SafeAreaView>
101101
<FlatList
102+
contentInsetAdjustmentBehavior="automatic"
102103
{...rest}
103104
data={
104105
query

0 commit comments

Comments
 (0)