我正在调整我的应用程序到iOS 7,当我阅读文档时,我在此链接下的popoverArrowDirection下读了这一行:
"(已弃用.弹出窗口在iOS 7及更高版本中不使用箭头.)"
这很奇怪,因为我的popover似乎在iOS 7中仍然有箭头.我只是错误地理解这个吗?
这看起来像是文档中的错误。箭头可能被设计师放在砧板上,但在可用性测试中又恢复了决定。
如果您查看UIPopoverController.h
,您不会看到任何弃用属性(例如NS_AVAILABLE_IOS
或NS_DEPRECATED_IOS
):
/* Returns the direction the arrow is pointing on a presented popover. Before
presentation, this returns UIPopoverArrowDirectionUnknown.
*/
@property (nonatomic, readonly) UIPopoverArrowDirection popoverArrowDirection;
Run Code Online (Sandbox Code Playgroud)
将此与以下进行对比-[NSString sizeWithFont:constrainedToSize:]
:
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size NS_DEPRECATED_IOS(2_0, 7_0, "Use -boundingRectWithSize:options:attributes:context:");
Run Code Online (Sandbox Code Playgroud)
这些属性很重要,因为它们会生成编译器警告和错误。它们也由实际编写 UI 代码的人员维护。
将属性的缺乏与您看到的行为直接与文档相矛盾的事实相结合,您真的不应该担心它。如果它确实困扰您,可以提交错误报告。