Closed
Description
Hey folks,
We're trying to position a View
above its parent using a negative top. iOS renders it the way I'd expect:
But Android is trimming the view to match the parent:
Code:
class RNPositionBug extends Component {
render() {
return (
<View style={styles.container}>
<View style={styles.box}>
<View style={styles.inner}/>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
box: {
width: 200,
height: 200,
backgroundColor: 'red',
},
inner: {
position: 'relative',
top: -50,
width: 100,
height: 100,
backgroundColor: 'blue',
}
});
Tested in React-Native 0.24.1, OSX. Tried to use both absolute and relative positioning on the inner view.
Any ideas/pointers are appreciated, thanks!