[英]Aviary crop presets not working on iOS
I'm trying to force users to crop their photo to a square with Aviary. 我试图强迫用户将照片裁剪到Aviary的正方形。 As described in the Aviary documentation here , it is possible to disable custom crops and specify the presets manually.
如此处的Aviary文档中所述,可以禁用自定义裁剪并手动指定预设。 I am attempting the following:
我正在尝试以下操作:
[AFPhotoEditorCustomization setCropToolOriginalEnabled:NO];
[AFPhotoEditorCustomization setCropToolCustomEnabled:NO];
NSDictionary *SIZE = [[NSDictionary alloc] initWithObjectsAndKeys:
@"kAFCropPresetName",@"square",
@"kAFCropPresetWidth",@"1.0f",
@"kAFCropPresetHeight",@"1.0f",
nil];
[AFPhotoEditorCustomization setCropToolPresets:[[NSArray alloc] initWithObjects:SIZE, nil]];
But this does not work. 但这是行不通的。 This results is 0 cropping options:
结果是0裁剪选项:
您应该使用以下代码:
[AFPhotoEditorCustomization setCropToolOriginalEnabled:NO]; [AFPhotoEditorCustomization setCropToolCustomEnabled:NO]; NSDictionary * square = @{kAFCropPresetName: @"Square", kAFCropPresetHeight : @(1.0f), kAFCropPresetWidth : @(1.0f)}; [AFPhotoEditorCustomization setCropToolPresets:@[square]];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.