2014-12-05 35 views
0

我試圖強制用戶將他們的照片裁剪爲有百鳥園的廣場。如Aviary documentation here中所述,可以禁用自定義作物並手動指定預設。我正在嘗試以下操作:百鳥園作物預設不適用於iOS

[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

你應該使用下面的代碼:

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

+0

在我的情況不工作。作爲圖書館改變與Adobe,甚至用AdobeImageEditorCustomization而不是AFPhotoEditorCustomization。 – karan 2016-11-17 12:30:59