-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathBasicUsage.js
46 lines (41 loc) · 1.3 KB
/
BasicUsage.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
import React from 'react';
import { StyleSheet, Text, Image, TouchableOpacity, View, Dimensions } from 'react-native';
import { Header } from 'react-navigation';
import HeaderImageScrollView, { TriggeringView } from 'react-native-image-header-scroll-view';
const MIN_HEIGHT = Header.HEIGHT;
const styles = StyleSheet.create({
container: {
flex: 1,
},
image: {
height: 200,
width: Dimensions.get('window').width,
},
});
class BasicUsage extends React.Component {
render() {
return (
<View style={styles.container}>
<HeaderImageScrollView
maxHeight={200}
minHeight={MIN_HEIGHT}
headerImage={require('../../assets/NZ.jpg')}
renderForeground={() => (
<View style={{ height: 150, justifyContent: 'center', alignItems: 'center' }}>
<TouchableOpacity onPress={() => console.log('tap!!')}>
<Text style={{ backgroundColor: 'transparent' }}>Tap Me!</Text>
</TouchableOpacity>
</View>
)}
>
<View style={{ height: 1000 }}>
<TriggeringView onHide={() => console.log('text hidden')}>
<Text>Scroll Me!</Text>
</TriggeringView>
</View>
</HeaderImageScrollView>
</View>
);
}
}
export default BasicUsage;