-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathList.js
37 lines (30 loc) · 838 Bytes
/
List.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import { ScrollView, View, Text, Dimensions, StyleSheet } from 'react-native';
const { width, height } = Dimensions.get('window');
const Page1 = () => (
<View style={{ flex: 1, backgroundColor: 'red', width: width }}>
<Text>Page 1</Text>
</View>
);
const Page2 = () => <View style={{ flex: 1, backgroundColor: 'green', width: width }}></View>;
const Page3 = () => (
<View style={{ flex: 1, backgroundColor: 'blue', width: width }}>
<Text>Page 3</Text>
</View>
);
const HorizontalScrollView = () => (
<ScrollView horizontal pagingEnabled style={{ flex: 1 }}>
<Page1 />
<Page2 />
<Page3 />
</ScrollView>
);
const styles = StyleSheet.create({
page: {
height: height * 0.9,
width: width,
backgroundColor: '#fff',
flexDirection: 'column',
},
});
export default HorizontalScrollView;