zoukankan      html  css  js  c++  java
  • 使用react-native-blur

    1.

    • npm install react-native-blur --save
    • react-native link react-native-blur

    2.在安卓上只是link还是不够,还要配置,否则安装成功后还是闪退

      打开android/app/build.gradle,添加加黑的代码

      

    android {
        // make sure to use 23.0.3 or greater
        buildToolsVersion '23.0.3' // 这行与我根目录中的build.grale的版本一致
    
        // ...
        defaultConfig {
            // Add these lines below the existing config
            renderscriptTargetApi 23
            renderscriptSupportModeEnabled true
        }
    }

      下面的图片是从官网截图来的 

     

     3.在需要的项目文件中引入

    import { BlurView, VibrancyView } from "@react-native-community/blur";

    4.使用的时候一定要将以下2个放在一起,不然没有效果
    <BlurView
              style={styles.absolute}
              viewRef={this.state.viewRef}
              blurType="light"
              blurAmount={10}
            />
            <Image
              ref={img => {
                this.backgroundImage = img;
              }}
              source={{ uri }}
              style={styles.absolute}
              onLoadEnd={this.imageLoaded.bind(this)}
            />
     
  • 相关阅读:
    CodeForces 514B
    CodeForces 514A
    UVa 818
    HDU 1003
    UVa百题总结
    UVa 11526
    UVa 12412
    UVa 211
    UVa 1587
    UVa 225 – Golygons [DFS+剪枝]
  • 原文地址:https://www.cnblogs.com/lude1994/p/11113163.html
Copyright © 2011-2022 走看看