Currently, I am working on creating a profile page UI where the profile data such as name and bio container should remain 50% at the bottom of its top component, which is currently the cover picture.
This is the React Native code I have so far:
<View style={styles.container}>
<View style={styles.coverContainer}>
</View>
<View style={styles.profileDataContainer}>
</View>
<View style={styles.intrestsContainer}>
</View>
<View style={styles.topicsContainer}>
</View>
</View>
Here are the current styles being applied:
const styles = StyleSheet.create({
container: {
},
coverContainer: {
height : 200,
backgroundColor : 'blue'
},
profileDataContainer: {
marginHorizontal : 30,
backgroundColor: 'white',
height : 200,
shadowColor: "#e5e5e5",
shadowOffset: {
width: 0,
height: 2
},
shadowRadius: 2,
shadowOpacity: 1.0,
elevation : 4,
marginTop : -100,
}
});
I have set marginTop
to -100 in order to achieve the desired structure.
https://i.sstatic.net/urHMV.png
After setting the marginTop
to -100, this is how it looks like now. However, it's not responsive as increasing the size of the white block causes it to shift from the center position.
I need assistance on how to make it responsive :(