gpt4 book ai didi

ios - 将本地包中的图像发布到 Pinterest iphone。

转载 作者:行者123 更新时间:2023-11-29 03:39:31 26 4
gpt4 key购买 nike

我使用以下代码通过 Web View 实现了 PinInterest:

NSString *description = @"Post your description here";
NSURL* sUrl = [NSString stringWithFormat:@"http://4.bp.blogspot.com/-w4oTZjlpgwo/T5_pi-KJPuI/AAAAAAAAAoM/rKm3E0XCbgY/s1600/red_rose_flower3.jpg"];// pass your link here with your image name

// NSLog(@"URL:%@", sUrl);
NSString *protectedUrl = ( NSString *)CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(NULL,( CFStringRef)sUrl, NULL, (CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)));
NSLog(@"Protected URL:%@", protectedUrl);
NSString *imageUrl = [NSString stringWithFormat:@"\"%@\"", sUrl];

imageUrl=[[NSBundle mainBundle]pathForResource:mAppDelegate.imagename ofType:nil];

NSString *buttonUrl = [NSString stringWithFormat:@"\"http://pinterest.com/pin/create/button/?url=www.flor.com&media=%@&description=%@\"", protectedUrl, description];

NSMutableString *htmlString = [[NSMutableString alloc] initWithCapacity:1000];
[htmlString appendFormat:@"<html> <body>"];
[htmlString appendFormat:@"<p align=\"center\"><a href=%@ class=\"pin-it-button\" count-layout=\"horizontal\"><img border=\"0\" src=\"http://assets.pinterest.com/images/PinExt.png\" title=\"Pin It\" /></a></p>", buttonUrl];
[htmlString appendFormat:@"<p align=\"center\"><img width=\"300px\" height = \"400px\" src=%@></img></p>", imageUrl];
[htmlString appendFormat:@"<script type=\"text/javascript\" src=\"//assets.pinterest.com/js/pinit.js\"></script>"];
[htmlString appendFormat:@"</body> </html>"];
return htmlString;

我也尝试过使用 PinInterest iOS SDK,但我发现它只能固定来自 url 的图像。

我需要从本地捆绑图像中固定图像。任何帮助将不胜感激。

最佳答案

阅读文档一次,他们说,现在,“我们只支持固定来自网址的图像。将来,我们将添加对固定本地镜像的支持。”我认为这回答了你的问题。需要更多说明芦苇this .希望这有帮助:)

关于ios - 将本地包中的图像发布到 Pinterest iphone。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18643165/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com