react-native 扫一扫功能(二维码扫描)功能开发
发布时间:2020-12-15 20:25:01 所属栏目:百科 来源:网络整理
导读:1.安装插件 yarn add react-native-smart-barcode 2.关联 react-native link react-native-smart-barcode 3.修改 android/settings.gradle rootProject.name = ‘Example‘include ‘:react-native-smart-barcode‘project(‘:react-native-smart-barcode‘)
1.安装插件 yarn add react-native-smart-barcode 2.关联 react-native link react-native-smart-barcode 3.修改 android/settings.gradle rootProject.name = ‘Example‘ include ‘:react-native-smart-barcode‘ project(‘:react-native-smart-barcode‘).projectDir = new File(rootProject.projectDir,‘../node_modules/react- native-smart-barcode/android‘) include ‘:app‘ 4.修改 android/app/build.gradle dependencies { compile project(‘:react-native-smart-barcode‘) ... } 5.修改 android/app/src/main/AndroidManifest.xml <!-- smart-barcode所需权限 开始--> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" /> <!-- smart-barcode所需权限 结束--> 6.修改 android/app/src/main/java/com/example/MainApplication.java import com.reactnativecomponent.barcode.RCTCapturePackage; new RCTCapturePackage(), . (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- ruby-on-rails – Rails 4:after_update回调导致无限循环
- ios – 如何使堆栈视图或容器视图包装内容?
- Cocos2dx中RotateTo对旋转方向的处理
- javascript中AJAX用法实例分析
- ruby-on-rails – 如果config.cache_classes = true,Rails找
- 如果派生中没有数据成员,C是虚拟析构函数还是需要的吗?
- 如何使用XmlDocument在c#.net CF 3.5中添加属性到xml
- c# – LINQ是否加载了请求中的每个对象?
- lrz压缩图片,上传七牛
- ruby-on-rails – 用于在亚马逊云上存储heroku应用程序资产