diff --git a/README.md b/README.md index 081002fa1..6c348e9f8 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,7 @@ ImagePicker.clean() | cropperCancelText (ios only) | string (default Cancel) | Cancel button text | | cropperCancelColor (ios only) | string (default tint `iOS` color ) | HEX format color for the Cancel button. Default value is the default tint iOS color [controlled by TOCropViewController](https://github.com/TimOliver/TOCropViewController/blob/a942414508012b13102f776eb65dac655f31cabb/Objective-C/TOCropViewController/Views/TOCropToolbar.m#L433) | | cropperRotateButtonsHidden (ios only) | bool (default false) | Enable or disable cropper rotate buttons | +| aspectRatioPickerButtonHidden (ios only)  | bool (default false)         | Enable or disable cropper aspect ratio button | #### Smart Album Types (ios) diff --git a/index.d.ts b/index.d.ts index 59a91557d..61f66d7f9 100644 --- a/index.d.ts +++ b/index.d.ts @@ -348,6 +348,14 @@ declare module "react-native-image-crop-picker" { * @default Android: 1, iOS: 0.8 */ compressImageQuality?: number; + + /** + * Enable or disable cropper aspect ratio button. + * + * @platform iOS only + * @default false + */ + aspectRatioPickerButtonHidden?: boolean; } type CropperOptions = ImageOptions & { diff --git a/ios/src/ImageCropPicker.mm b/ios/src/ImageCropPicker.mm index 354ad09c8..0479ee29b 100644 --- a/ios/src/ImageCropPicker.mm +++ b/ios/src/ImageCropPicker.mm @@ -917,6 +917,7 @@ - (void)cropImage:(UIImage *)image { cropVC.doneButtonTitle = [self.options objectForKey:@"cropperChooseText"]; cropVC.cancelButtonTitle = [self.options objectForKey:@"cropperCancelText"]; cropVC.rotateButtonsHidden = [[self.options objectForKey:@"cropperRotateButtonsHidden"] boolValue]; + cropVC.aspectRatioPickerButtonHidden = [[self.options objectForKey:@"aspectRatioPickerButtonHidden"] boolValue]; cropVC.modalPresentationStyle = UIModalPresentationFullScreen; if (@available(iOS 15.0, *)) { diff --git a/src/NativeImageCropPicker.ts b/src/NativeImageCropPicker.ts index f2a4c0c0d..17137d12a 100644 --- a/src/NativeImageCropPicker.ts +++ b/src/NativeImageCropPicker.ts @@ -46,6 +46,7 @@ export type PickerOptions = { enableRotationGesture?: boolean; disableCropperColorSetters?: boolean; useFrontCamera?: boolean; + aspectRatioPickerButtonHidden?: boolean; }; export interface Spec extends TurboModule {