Aviary裁剪预设不适用于iOS

时间:2014-12-05 23:15:38

标签: ios aviary

我正试图强迫用户将他们的照片裁剪成Aviary的广场。如Aviary documentation here中所述,可以禁用自定义裁剪并手动指定预设。我正在尝试以下方法:

[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]];

但这不起作用。结果是0裁剪选项:

1 个答案:

答案 0 :(得分:1)

您应该使用以下代码:

[AFPhotoEditorCustomization setCropToolOriginalEnabled:NO]; [AFPhotoEditorCustomization setCropToolCustomEnabled:NO]; NSDictionary * square = @{kAFCropPresetName: @"Square", kAFCropPresetHeight : @(1.0f), kAFCropPresetWidth : @(1.0f)}; [AFPhotoEditorCustomization setCropToolPresets:@[square]];