Commit 8ab1bdb9 authored by Syan's avatar Syan

添加使用说明

parent 15ad81c9
# react-native-syan-image-picker # react-native-syan-image-picker
## Getting started ## 功能介绍
`$ npm install react-native-syan-image-picker --save` 多图片选择器
Android 基于 [PictureSelector 2.0](https://github.com/LuckSiege/PictureSelector)
iOS 基于 [TZImagePickerController 1.9.0](https://github.com/banchichen/TZImagePickerController)
### Mostly automatic installation
## 安装使用
`$ npm install react-native-syan-image-picker --save`
`$ react-native link react-native-syan-image-picker` `$ react-native link react-native-syan-image-picker`
### Manual installation ### iOS
- TARGETS -> Build Phases -> Link Binary -> Copy Bundle Resources
点击"+"按钮,在弹出的窗口中点击“Add Other”按钮,选择
```
node_modules/react-native-syan-image-picker/ios/TZImagePickerController/TZImagePickerController.bundle
```
- 项目目录->Info.plist->增加3项
```
"Privacy - Camera Usage Description
"Privacy - Location When In Use Usage Description"
"Privacy - Photo Library Usage Description"
```
### Android
- android 下build.gradle文件添加
```
allprojects {
repositories {
mavenLocal()
jcenter()
maven { url "https://jitpack.io" }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
```
## link失败手动添加
#### iOS #### iOS
1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]` 1. In XCode, in the project navigator, right click `Libraries``Add Files to [your project's name]`
...@@ -19,6 +57,8 @@ ...@@ -19,6 +57,8 @@
3. In XCode, in the project navigator, select your project. Add `libRNSyanImagePicker.a` to your project's `Build Phases``Link Binary With Libraries` 3. In XCode, in the project navigator, select your project. Add `libRNSyanImagePicker.a` to your project's `Build Phases``Link Binary With Libraries`
4. Run your project (`Cmd+R`)< 4. Run your project (`Cmd+R`)<
#### Android #### Android
1. Open up `android/app/src/main/java/[...]/MainActivity.java` 1. Open up `android/app/src/main/java/[...]/MainActivity.java`
...@@ -34,20 +74,4 @@ ...@@ -34,20 +74,4 @@
compile project(':react-native-syan-image-picker') compile project(':react-native-syan-image-picker')
``` ```
#### Windows
[Read it! :D](https://github.com/ReactWindows/react-native)
1. In Visual Studio add the `RNSyanImagePicker.sln` in `node_modules/react-native-syan-image-picker/windows/RNSyanImagePicker.sln` folder to their solution, reference from their app.
2. Open up your `MainPage.cs` app
- Add `using Com.Reactlibrary.RNSyanImagePicker;` to the usings at the top of the file
- Add `new RNSyanImagePickerPackage()` to the `List<IReactPackage>` returned by the `Packages` method
## Usage
```javascript
import RNSyanImagePicker from 'react-native-syan-image-picker';
// TODO: What to do with the module?
RNSyanImagePicker;
```
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment