4

I need to do a blur effect on Image component on Android with react native, this is possible or how can i do it?

import React, { Component } from 'react';
import {
  StyleSheet,
  Text,
  View,
  Image,
} from 'react-native';

export default class Main extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Image source={require('../../Images/bgImg.png')}
        style={styles.imagen}
        />
      </View>
    );
  }
}
Jose Noriega
  • 245
  • 3
  • 12

2 Answers2

6

You can now set blurRadius property on your Image.

<Image
  style={styles.imagen}
  source={require('../../Images/bgImg.png')} 
  blurRadius={1}
/>

Or you can use a community library such as https://github.com/react-native-community/react-native-blur which works on both iOS and Android

patngo
  • 667
  • 3
  • 12
0

Use Attribute blurRadius increase the number to get more blurred image .

<Image 
    source={require('../../Images/bgImg.png')}
    style={styles.imagen}
    blurRadius={1}
    />
yatin deokar
  • 730
  • 11
  • 20