0 points

React Native backgroundColor overlay over image - Stack Overflow


dashboard

Sat Aug 08 2020 04:06:55 GMT+0000 (UTC)

Posted by @rdemo #javascript

render() {
  return (
    <View style={styles.container}>
      <Image source={require('./assets/climbing_mountain.jpeg')} style={styles.imageContainer}>
      </Image>
      <View style={styles.overlay} />
    </View>
  )
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    width: null,
    height: null,
  },
  imageContainer: {
    flex: 1,
    width: null,
    height: null,
  },
  overlay: {
    ...StyleSheet.absoluteFillObject,
    backgroundColor: 'rgba(69,85,117,0.7)',
  }
})
content_copy Copy

https://stackoverflow.com/questions/41626402/react-native-backgroundcolor-overlay-over-image