Skip to content

Instantly share code, notes, and snippets.

@padupuy
Created May 30, 2017 16:54
Show Gist options
  • Save padupuy/43e0e91ce8608dd36c2525fc84c66104 to your computer and use it in GitHub Desktop.
Save padupuy/43e0e91ce8608dd36c2525fc84c66104 to your computer and use it in GitHub Desktop.
Android zIndex OK
import React, {Component} from 'react';
import {
StyleSheet,
View,
Text,
} from 'react-native';
export default class DummyScreen extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.up}/>
<View style={styles.middle}>
<Text style={styles.title}>Text</Text>
</View>
<View style={styles.down}>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: 'black',
flex: 1,
},
up: {
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'black',
marginHorizontal: 20,
position: 'relative',
flex: 1,
},
down: {
backgroundColor: '#F0F0F0',
flex: 1,
},
middle: {
backgroundColor: 'white',
top: 40,
marginHorizontal: 20,
zIndex: 1,
elevation: 1
},
title: {
fontSize: 36,
textAlign: 'center',
marginTop: 20,
marginBottom: 20,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment