forked from Kishanjvaghela/react-native-cardview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExample2.js
124 lines (121 loc) · 3.21 KB
/
Example2.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import { StyleSheet, Text, View, SafeAreaView } from 'react-native';
import CardView from 'react-native-cardview';
export default class Example2 extends Component {
render() {
return (
<SafeAreaView style={styles.safeAreaView}>
<View style={styles.container}>
<View flexDirection="row">
<CardView
cardElevation={0}
cardMaxElevation={0}
cornerRadius={5}
style={styles.card}
>
<View>
<Text style={{ backgroundColor: 'yellow' }}>Elevation 0</Text>
<Text>Elevation 1</Text>
<Text>Ele</Text>
</View>
</CardView>
<CardView
cardElevation={1}
cardMaxElevation={1}
cornerRadius={5}
style={styles.card}
>
<Text style={styles.text}>Elevation 1</Text>
</CardView>
</View>
<View flexDirection="row">
<CardView
cardElevation={2}
cardMaxElevation={2}
cornerRadius={5}
style={styles.card}
>
<Text style={styles.text}>Elevation 2</Text>
</CardView>
<CardView
cardElevation={3}
cardMaxElevation={3}
cornerRadius={5}
style={styles.card}
>
<Text style={styles.text}>Elevation 3</Text>
</CardView>
</View>
<View flexDirection="row">
<CardView
cardElevation={4}
cardMaxElevation={4}
cornerRadius={5}
style={styles.card}
>
<Text style={styles.text}>Elevation 4</Text>
</CardView>
<CardView
cardElevation={5}
cardMaxElevation={5}
cornerRadius={5}
style={styles.card}
>
<Text style={styles.text}>Elevation 5</Text>
</CardView>
</View>
<View flexDirection="row">
<CardView
cardElevation={6}
cardMaxElevation={6}
cornerRadius={5}
style={styles.card}
>
<Text style={styles.text}>Elevation 6</Text>
</CardView>
<CardView
cardElevation={7}
cardMaxElevation={7}
cornerRadius={5}
style={styles.card}
>
<Text style={styles.text}>Elevation 7</Text>
</CardView>
</View>
</View>
</SafeAreaView>
);
}
}
const styles = StyleSheet.create({
safeAreaView: {
flex: 1
},
container: {
flex: 1
// backgroundColor: '#EEEEEE',
},
card: {
backgroundColor: 'white',
alignItems: 'center',
justifyContent: 'center',
alignSelf: 'center',
flex: 1,
margin: 10
},
text: {
textAlign: 'center',
margin: 10,
height: 75
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5
}
});