ios – CoreSpotlight缩略图图像未显示在Spotlight搜索上

ios – CoreSpotlight缩略图图像未显示在Spotlight搜索上,第1张

概述我试图在Core Spotlight的帮助下搜索我的应用程序内容.一切都很好,标题和描述来了,但没有缩略图. 这是我正在尝试的: CSSearchableItemAttributeSet *attributeSet = [[CSSearchableItemAttributeSet alloc]initWithItemContentType:(NSString *)kUTTypeImage];a 我试图在Core Spotlight的帮助下搜索我的应用程序内容.一切都很好,标题和描述来了,但没有缩略图.

这是我正在尝试的:

CSSearchableItemAttributeSet *attributeSet = [[CSSearchableItemAttributeSet alloc]initWithItemContentType:(Nsstring *)kUTTypeImage];attributeSet.Title = @"My First Spotlight Search";attributeSet.contentDescription = @"This is my first spotlight Search";attributeSet.keywords = [NSArray arrayWithObjects:@"Hello",@"Welcome",@"Spotlight",nil];UIImage *image = [UIImage imagenamed:@"searchIcon.png"];NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)];attributeSet.thumbnailData = imageData;CSSearchableItem *item = [[CSSearchableItem alloc]initWithUniqueIDentifIEr:@"com.deeplink" domainIDentifIEr:@"spotlight.sample" attributeSet:attributeSet];[[CSSearchableIndex defaultSearchableIndex] indexSearchableItems:@[item] completionHandler: ^(NSError * __nullable error) {    if (!error)        NSLog(@"Search item indexed");}];
解决方法 iOS 9 beta 1发行说明指出缩略图尚未用于搜索结果.见: https://developer.apple.com/library/prerelease/ios/releasenotes/General/RN-iOSSDK-9.0/index.html 总结

以上是内存溢出为你收集整理的ios – CoreSpotlight缩略图图像显示在Spotlight搜索上全部内容,希望文章能够帮你解决ios – CoreSpotlight缩略图图像未显示在Spotlight搜索上所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1103012.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-28
下一篇2022-05-28

发表评论

登录后才能评论

评论列表(0条)

    保存