Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- render() {
- const isIos = Platform.OS === 'ios'
- const SPACER_SIZE = 1000; //arbitrary size
- const TOP_COLOR = 'white';
- const BOTTOM_COLOR = 'papayawhip';
- return (
- <ScrollView
- style={{backgroundColor: isIos ? BOTTOM_COLOR : TOP_COLOR }}
- contentContainerStyle={{backgroundColor: TOP_COLOR}}
- contentInset={{top: -SPACER_SIZE}}
- contentOffset={{y: SPACER_SIZE}}>
- {isIos && <View style={{height: SPACER_SIZE}} />}
- //...your content here
- </ScrollView>
- );
- }
Add Comment
Please, Sign In to add comment