React Native Blur
UIVisualEffectView的模糊和震动效果的组件实现
安装
通过npm安装包:
npm install react-native-blur
连接你的本地依赖:
react-native link react-native-blur
(仅供Android) 在android/app/build.gradle中添加:
repositories {
maven { url 'https://github.com/500px/500px-android-blur/raw/master/releases/' }
}
buildscript {
repositories {
maven { url 'https://github.com/500px/500px-android-blur/raw/master/releases/' }
}
dependencies {
classpath 'com.fivehundredpx:blurringview:1.0.0'
}
}
通过添加下列代码在代码中添加JS部分:
const { BlurView, VibrancyView } = require('react-native-blur');