Я пытаюсь разместить свое изображение поверх другого, но уже безуспешно ...
Я пытался использовать position:'absolute'
и другие варианты, которые я видел, но это не помогло.не работает для меня.
render() {
let locationFlag=Platform.OS === 'ios'?true:false
return (
<View style={styles.container}>
<LinearGradient
colors={[ '#75a4e7','#7d50f6']}
start={{x: .2, y: 1}}
end={{x:.8,y:0}}
locations={locationFlag?[.15,1]:[.18,2.1]}
style={styles.gradient}>
<View style={styles.profilePhotoContainer}>
<TouchableOpacity onPress={this.handleEditProfileImage.bind(this)}>
<Image
style={styles.profileImage}
source={this.state.profilePhoto}
/>
</TouchableOpacity>
</View>
</LinearGradient>
<View style={
[styles.profileBox]}
>
</View>
</View>
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'flex-start',
alignSelf: 'stretch',
backgroundColor: Colors.LIGHT_GRAY
},
gradient: {
alignSelf: 'stretch',
alignItems: 'center',
flexDirection: 'column',
height: Dimensions.get('window').height * .35,
},
profilePhotoContainer: {
zIndex: 50,
position: 'absolute',
backgroundColor:'blue',
top: Dimensions.get('window').height * .12,
elevation: 4,
},
profileImage: {
zIndex: 5,
width: 100,
height: 100,
borderRadius: 50,
borderWidth: 4,
borderColor: '#FFF',
backgroundColor: 'transparent',
},
profileBox: {
zIndex: 1,
position: 'absolute',
left: Dimensions.get('window').width * .07,
top: Dimensions.get('window').height * .18,
borderRadius: 8,
shadowRadius: 8,
elevation: 3,
shadowOpacity: 0.3,
backgroundColor: 'yellow',
width: Dimensions.get('window').width * .86,
height: Dimensions.get('window').height * .50,
}
В ссылке вы можете увидеть, что я делал до сих пор и в чем проблема:
https://imgur.com/a/kC4ZTUn
Я хочуДля достижения этой ситуации:
https://imgur.com/a/KMSRVfZ
Спасибо