Giter Site home page Giter Site logo

peakpei / react-native-gaussianblurdemo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guangqiang-liu/react-native-gaussianblurdemo

0.0 2.0 0.0 284 KB

实现页面背景图片高斯模糊效果

License: MIT License

JavaScript 34.26% Python 14.91% Java 12.91% Objective-C 37.92%

react-native-gaussianblurdemo's Introduction

前言

最近在群里发现有人问类似于高斯模糊的效果怎么实现,正好前段时间作者开源的RN项目OneM中使用到了这一技术,所以在这作者单独的一个实现高斯模糊效果的Demo示例给到大家,供大家学习参考。想查看作者的完整RN项目OneM请点击

预览效果图

gif

如何使用

  • npm install react-native-blur --save
  • react-native link react-native-blur
  • import {BlurView, VibrancyView} from 'react-native-blur'
<BlurView
  style={styles.absolute}
  viewRef={this.state.viewRef}
  blurType="light"
  blurAmount={10}
/>

更多用法请查看官方文档

https://github.com/react-native-community/react-native-blur

核心代码

render() {
    return (
      <View style={styles.container}>
        <Image
          ref={(img) => { this.backgroundImage = img}}
          source={{uri}}
          style={styles.absolute}
          onLoadEnd={this.imageLoaded.bind(this)}
        />
        <BlurView
          style={styles.absolute}
          viewRef={this.state.viewRef}
          blurType="light"
          blurAmount={10}
        />
        <Text>Hi, I am some unblurred text</Text>
      </View>
    )
  }
 

作者简书地址

http://www.jianshu.com/u/023338566ca5

总结

react-native-blur 组件的使用还是很简单的,同学们可以直接下载Demo示例查看使用方法即可,或者直接在官方文档中查看详细的使用教程。同学觉得文章对你有帮助,请 给个 star 给个 关注 谢谢。

react-native-gaussianblurdemo's People

Contributors

guangqiang-liu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.