npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-pick-img-crop

v1.1.1

Published

高新能实用的相册图片选择器,可以多张图片选择和裁剪,也可以单张图片选择

Downloads

284

Readme

react-native-pick-img-crop

高新能实用的相册图片选择器,可以多张图片选择、裁剪、单张图片选择、拍照

补充

目前此库正在开发中.... ios暂时不支持手动自定义裁剪,只支持批量后台裁剪(以传入裁剪的宽高的比例进行裁剪);可以多张图片选择,也可以单张图片选择 android可以基本使用,但Android和设计有一定差距,有兴趣的童靴可以先自己修改,代码可用

展示ui图

安装组件:

npm i --save react-native-pick-img-crop

传统链接

react-native link react-native-pick-img-crop

ios链接原生

pod 链接

将 pod 'RNPickImgCrop', :path => '../node_modules/react-native-pick-img-crop' 拷贝进Podfile即可;

Android

### `settings.gradle`
```gradle
include ':react-native-pick-img-crop'
project(':react-native-pick-img-crop').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pick-img-crop/android')
```
### `build.gradle`
```gradle
dependencies {
    compile project(':react-native-pick-img-crop')
}
```

###`MainApplication.java`
```java

import com.luck.picture.lib.PhotoCropPickerPackage;

public class MainApplication extends Application implements ReactApplication {
 @Override
   protected List<ReactPackage> getPackages() {
     return Arrays.<ReactPackage>asList(
         new MainReactPackage(),
           new PhotoCropPickerPackage()
     );
   }
}
```

使用

import PickImgCroper from "react-native-pick-img-crop";
PickImgCroper.openPicker({
                                     cropping:false,//bool 可不传,//是否剪辑图片 默认是false;flase时打开大图,true时进入裁剪控件
                                     multiple:true,//bool 可不传,//是否图片多选 默认是false;多选时显示先后选中顺序,取消其中任意一个选中按顺序缩减,单选只显示1,选中另一个则取消上一个选中
                                     maxCount:-1,//number 可不传,//最大可选数量,multiple为true此字段有效;不传或为-1时,选择数量不受限制
                                     cropWidth:600,//number 可不传,//裁剪宽度 cropping为true并且cropWidth和cropHeight同时为正整数时有效,不传或为小于0时,以最短边为准进行居中裁剪
                                     cropHeight:450,//number 可不传,//裁剪高度 cropping为true并且cropWidth和cropHeight同时为正整数时有效,不传或为小于0时,以最短边为准进行居中裁剪
                                 })
.then(res=>{
    console.info("res",res)
});

欢迎交流

欢迎提问交流;若有bug,请添加bug截图或代码片段,以便更快更好的解决问题。 欢迎大家一起交流

我的博客