简体   繁体   English

如何在ios版本中设置Aviary裁剪预设?

[英]How to set Aviary crop presets in ios version?

I can find mention of setting cropPresets in the web version of Aviary (and feather_crop_values in android), but nothing in the ios sdk. 我可以在网络版的Aviary(以及android中的feather_crop_values)中找到设置cropPresets的提及,但ios sdk中没有任何内容。 Is there anyway to set the crop presets/values in the ios version, or is this exclusive to the web and android versions? 无论如何在ios版本中设置裁剪预设/值,还是仅限于web和Android版本?

There is an option to pass NSDictionary options, but the toolset order is the only example given. 有一个选项可以传递NSDictionary选项,但工具集顺序是给出的唯一示例。 I tried doing an dictionary with the key "cropPresets" and a value that was an NSArray with an entry of "48x48" as NSString, but it seemed to ignore it and display the default crop presets. 我尝试使用键“cropPresets”创建一个字典,并使用一个NSArray作为NSString输入“48x48”,但它似乎忽略它并显示默认的裁剪预设。 I suppose I could keep shooting in the dark, unless someone has a better idea? 我想我可以继续在黑暗中射击,除非有人有更好的主意?

Just following up for those who encounter the same problem: Aviary for iOS now supports custom crop presets so go right ahead and use it, as documented. 只需跟进那些遇到相同问题的人:Aviary for iOS现在支持自定义裁剪预设,因此请按照文档记录使用它。 I just coded up a test and it worked fine. 我刚编了一个测试,它工作正常。

http://www.aviary.com/ios/documentation#customization http://www.aviary.com/ios/documentation#customization

Just had to solve the same problem, so I thought I might share the code (it's included in their sample code: https://github.com/AviaryInc/Aviary-iOS-Sample-App/blob/master/AviaryDemo-iOS/AFSDKDemoViewController.m ) : 只是必须解决同样的问题,所以我想我可能会共享代码(它包含在他们的示例代码中: https//github.com/AviaryInc/Aviary-iOS-Sample-App/blob/master/AviaryDemo-iOS/ AFSDKDemoViewController.m ):

// Set Custom Crop Sizes
[AFPhotoEditorCustomization setOptionValue:@NO forKey:@"editor.tool.crop.enableOriginal"];
[AFPhotoEditorCustomization setOptionValue:@YES forKey:@"editor.tool.crop.enableCustom"];
NSDictionary * fourBySix = @{kAFCropPresetHeight : @(4.0f), kAFCropPresetWidth : @(6.0f)};
NSDictionary * fiveBySeven = @{kAFCropPresetHeight : @(5.0f), kAFCropPresetWidth : @(7.0f)};
NSDictionary * square = @{kAFCropPresetName: @"Square", kAFCropPresetHeight : @(1.0f), kAFCropPresetWidth : @(1.0f)};
[AFPhotoEditorCustomization setOptionValue:@[square, fourBySix, fiveBySeven] forKey:@"editor.tool.crop.presets"];

I had the same Problem just a view days ago. 我几天前就有一个相同的问题。

So i wrote them an e-mail. 所以我给他们写了一封电子邮件。 They answered me following: 他们回答我:

Customizing the crop options actually isn't yet officially supported on this platform (although we do support it for web and Android, which may be contributing to the confusion here). 实际上,该平台尚未正式支持自定义裁剪选项(尽管我们支持Web和Android,这可能会导致混乱)。 That said, we have this coming up soon in our roadmap and you should have no problem including only one crop size once that update is available. 也就是说,我们的路线图很快就会出现这种情况,一旦有更新,您应该没有问题,只包括一个裁剪尺寸。

So keep an eye out for the new update! 所以请留意新的更新!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM