javascript - how to make blur image on android? React-native - Stack Overflow

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

I need to do a blur effect on Image ponent 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>
    );
  }
}

I need to do a blur effect on Image ponent 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>
    );
  }
}
Share Improve this question asked Mar 12, 2018 at 3:33 Jose NoriegaJose Noriega 2453 silver badges12 bronze badges 5
  • Have you looked into this? github./rexlow/react-native-blur – Rex Low Commented Mar 12, 2018 at 3:35
  • Possible duplicate of how to make the blur effect with react-native? – Arun Commented Mar 12, 2018 at 3:37
  • yeah but I wanted to look for other options – Jose Noriega Commented Mar 12, 2018 at 3:40
  • this is for IOS – Jose Noriega Commented Mar 12, 2018 at 3:40
  • you can use opacity on view to make image little invisible – Sagar Chavada Commented Mar 12, 2018 at 4:19
Add a ment  | 

2 Answers 2

Reset to default 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 munity library such as https://github./react-native-munity/react-native-blur which works on both iOS and Android

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

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744898877a4599858.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信