Skip to content

Commit 9e66a3c

Browse files
feat(ios): add aspectRatioPickerButtonHidden prop to hide aspect ratio button
1 parent 05f1d0f commit 9e66a3c

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ ImagePicker.clean()
157157
| cropperCancelText (ios only) | string (default Cancel) | Cancel button text |
158158
| 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) |
159159
| cropperRotateButtonsHidden (ios only) | bool (default false) | Enable or disable cropper rotate buttons |
160+
| aspectRatioPickerButtonHidden (ios only)  | bool (default false)         | Enable or disable cropper aspect ratio button |
160161

161162
#### Smart Album Types (ios)
162163

index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,14 @@ declare module "react-native-image-crop-picker" {
348348
* @default Android: 1, iOS: 0.8
349349
*/
350350
compressImageQuality?: number;
351+
352+
/**
353+
* Enable or disable cropper aspect ratio button.
354+
*
355+
* @platform iOS only
356+
* @default false
357+
*/
358+
aspectRatioPickerButtonHidden?: boolean;
351359
}
352360

353361
type CropperOptions = ImageOptions & {

ios/src/ImageCropPicker.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,7 @@ - (void)cropImage:(UIImage *)image {
917917
cropVC.doneButtonTitle = [self.options objectForKey:@"cropperChooseText"];
918918
cropVC.cancelButtonTitle = [self.options objectForKey:@"cropperCancelText"];
919919
cropVC.rotateButtonsHidden = [[self.options objectForKey:@"cropperRotateButtonsHidden"] boolValue];
920+
cropVC.aspectRatioPickerButtonHidden = [[self.options objectForKey:@"aspectRatioPickerButtonHidden"] boolValue];
920921

921922
cropVC.modalPresentationStyle = UIModalPresentationFullScreen;
922923
if (@available(iOS 15.0, *)) {

src/NativeImageCropPicker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export type PickerOptions = {
4646
enableRotationGesture?: boolean;
4747
disableCropperColorSetters?: boolean;
4848
useFrontCamera?: boolean;
49+
aspectRatioPickerButtonHidden?: boolean;
4950
};
5051

5152
export interface Spec extends TurboModule {

0 commit comments

Comments
 (0)