[英]How do I support large tab bar previews in iOS 11?
In some of Apple's apps like Photos in iOS 11 if you hold down on a tab bar icon while your phone is in landscape and you have the larger accessibility size Dynamic Text turned on a large preview of the tab you are holding appearing. 在某些Apple应用中,例如iOS 11中的“照片”,如果您在手机处于横向状态时按住选项卡栏图标,并且具有较大的辅助功能,则“动态文本”会打开您所显示的选项卡的大预览。 How do I support this in my app?
如何在我的应用程序中支持此功能? Is it a new API or do I have to build it myself?
是新的API还是我必须自己构建它?
You can use PDF image assets and get large tab bar preview behavior for free. 您可以使用PDF图像资源,并免费获得大标签栏预览行为。
Check the "Preserve Vector Data" button in the attributes inspector for the PDF image asset. 在属性检查器中,检查PDF图像资产的“保留矢量数据”按钮。
https://developer.apple.com/videos/play/wwdc2017/204/ https://developer.apple.com/videos/play/wwdc2017/204/
The new property is: 新属性是:
// 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));
Which is on UIBarItem (which UITabBarItem inherits from). 它在UIBarItem(继承自UITabBarItem)上。 I've left the comment in from the header file as it's relevant.
我已经从头文件中删除了相关的注释。
It's also possible to set this under the 'accessibility' property in Interface Builder. 也可以在Interface Builder中的“ accessibility”属性下进行设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.