Skip to content

Instantly share code, notes, and snippets.

@que01
Last active September 13, 2017 05:55
Show Gist options
  • Save que01/bf1313201f202bd9e788c8e226d65e5f to your computer and use it in GitHub Desktop.
Save que01/bf1313201f202bd9e788c8e226d65e5f to your computer and use it in GitHub Desktop.
ignite demo
import React, { Component } from 'react'
import { ScrollView, Text, Image, View } from 'react-native'
import { Images } from '../Themes'
import Swiper from 'react-native-swiper'
// Styles
import styles from './Styles/LaunchScreenStyles'
const imgArr = {
img1: require('../Images/launch1.png'),
img2: require('../Images/launch2.png'),
img3: require('../Images/launch3.png')
}
export default class LaunchScreen extends Component {
render () {
return (
<Swiper style={styles.wrapper} loop={false} dotColor='#ccc'>
<View style={styles.slide}>
<Image source={imgArr.img1} style={styles.image}>
<View style={styles.imgTextWrapper}>
<Text style={styles.imageText}>1111</Text>
</View>
</Image>
</View>
<View style={styles.slide}>
<Image source={imgArr.img2} style={styles.image}>
<View style={styles.imgTextWrapper}>
<Text style={styles.imageText}>22222</Text>
</View>
</Image>
</View>
<View style={styles.slide}>
<Image source={imgArr.img3} style={styles.image}>
<View style={styles.imgTextWrapper}>
<Text style={styles.imageText}>33333</Text>
</View>
</Image>
</View>
</Swiper>
)
}
}
import { StyleSheet, Dimensions } from 'react-native'
import { Metrics, ApplicationStyles } from '../../Themes/'
const { width, height } = Dimensions.get('window')
export default StyleSheet.create({
...ApplicationStyles.screen,
wrapper: {
},
slide: {
flex: 1,
justifyContent: 'center',
alignItems: 'flex-start',
backgroundColor: 'rgba(0,0,0,0)'
},
image: {
width,
height,
flex: 1
},
imgTextWrapper: {
flex: 1,
// flexGrow:1,
height: 200,
alignItems: 'center',
justifyContent: 'center'
// backgroundColor: '#ccc'
},
imageText: {
fontSize: 14,
color: '#fff',
lineHeight: 35,
opacity: 0.8
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment