如何支持iOS 11中的大标签栏预览?

问题描述:

在苹果的一些应用程序中,如iOS 11中的照片,如果您在手机处于横向模式时按住选项卡栏图标,并且具有较大的辅助功能大小,则动态文本会打开您持续显示的选项卡的大型预览。我如何在我的应用程序中支持此功能?它是一个新的API还是我必须自己构建它? large tab bar preview如何支持iOS 11中的大标签栏预览?

您可以使用PDF图片资源并免费获取大标签栏预览行为。

检查PDF图像资产的属性检查器中的“保留矢量数据”按钮。

https://developer.apple.com/videos/play/wwdc2017/204/

Check Preserve Vector Data

enter image description here

新的属性是:

// Higher-resolution version of the standard image. Default is nil. Used for rendering assistive UI (e.g. for users with visual impairments who need large text). If not provided, the system may attempt to generate an image based on the standard image (for instance, by rasterizing matching PDF representations at a higher resolution). 
@property(nullable, nonatomic, strong) UIImage *largeContentSizeImage API_AVAILABLE(ios(11.0)); 

这是对UIBarItem(这UITabBarItem从继承)。我已经从头文件中留下了注释,因为它是相关的。

也可以在Interface Builder的'accessibility'属性下设置它。