|
| 1 | +import React from 'react'; |
| 2 | +import { StyleSheet, Image, View, Dimensions } from 'react-native'; |
| 3 | +import { NavigationBar } from '@exponent/ex-navigation'; |
| 4 | + |
| 5 | +import HeaderImageScrollView from 'react-native-image-header-scroll-view'; |
| 6 | + |
| 7 | +const MIN_HEIGHT = NavigationBar.DEFAULT_HEIGHT; |
| 8 | + |
| 9 | +const styles = StyleSheet.create({ |
| 10 | + image: { |
| 11 | + height: 200, |
| 12 | + width: Dimensions.get('window').width, |
| 13 | + }, |
| 14 | +}); |
| 15 | + |
| 16 | +class ColorsPage extends React.Component { |
| 17 | + render() { |
| 18 | + return ( |
| 19 | + <View style={{ flex: 1, marginTop: -MIN_HEIGHT }}> |
| 20 | + <HeaderImageScrollView |
| 21 | + maxHeight={150} |
| 22 | + minHeight={80} |
| 23 | + fadeOutForeground |
| 24 | + renderHeader={() => ( |
| 25 | + <Image source={require('../assets/cutecat.jpg')} style={styles.image} /> |
| 26 | + )} |
| 27 | + > |
| 28 | + <View style={{ height: 100, backgroundColor: 'blue' }} /> |
| 29 | + <View style={{ height: 100, backgroundColor: 'red' }} /> |
| 30 | + <View style={{ height: 100, backgroundColor: 'green' }} /> |
| 31 | + <View style={{ height: 100, backgroundColor: 'purple' }} /> |
| 32 | + <View style={{ height: 100, backgroundColor: 'orange' }} /> |
| 33 | + <View style={{ height: 100, backgroundColor: 'pink' }} /> |
| 34 | + <View style={{ height: 100, backgroundColor: 'brown' }} /> |
| 35 | + <View style={{ height: 100, backgroundColor: 'yellow' }} /> |
| 36 | + </HeaderImageScrollView> |
| 37 | + </View> |
| 38 | + ); |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +ColorsPage.route = { |
| 43 | + navigationBar: { |
| 44 | + tintColor: 'white', |
| 45 | + backgroundColor: 'transparent', |
| 46 | + borderBottomWidth: 0, |
| 47 | + statusBarHeight: 0, |
| 48 | + elevation: 0, |
| 49 | + }, |
| 50 | +}; |
| 51 | + |
| 52 | +export default ColorsPage; |
0 commit comments