Skip to content

Instantly share code, notes, and snippets.

@padupuy
Created May 30, 2017 16:29
Show Gist options
  • Save padupuy/1ddaf5070fb650e7d6eae02d3b0af37d to your computer and use it in GitHub Desktop.
Save padupuy/1ddaf5070fb650e7d6eae02d3b0af37d to your computer and use it in GitHub Desktop.
Android zIndex bug
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.down}>
<View style={styles.middle}>
<Text style={styles.title}>Text</Text>
</View>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
backgroundColor: 'black',
flex: 1,
},
up: {
justifyContent: 'center',
alignItems: 'center',
paddingBottom: 60,
backgroundColor: 'black',
marginHorizontal: 20,
position: 'relative',
flex: 1,
},
down: {
backgroundColor: '#F0F0F0',
flex: 1,
},
middle: {
backgroundColor: 'white',
top: -40,
marginHorizontal: 20,
},
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