swift – intrinsicContentSize() – 方法不会覆盖其超类中的任
发布时间:2020-12-14 05:53:27 所属栏目:百科 来源:网络整理
导读:我更新到Xcode 8 beta 5,现在在继承自UIView的类上收到以下错误: Method does not override any method from its superclassoverride public func intrinsicContentSize() - CGSize{ ...} 有解决方法吗? 请检查 the latest reference。 (你可以很容易的找
我更新到Xcode 8 beta 5,现在在继承自UIView的类上收到以下错误:
Method does not override any method from its superclass override public func intrinsicContentSize() -> CGSize { ... } 有解决方法吗?
请检查
the latest reference。
(你可以很容易的找到它只是把“内在的内容大小”在 Apple’s developer site的搜索栏。)
intrinsicContentSize已经成为一个计算属性,因此您需要以这种方式覆盖它: override public var intrinsicContentSize: CGSize { get { //... return someCGSize } } 或简单地: override public var intrinsicContentSize: CGSize { //... return someCGSize } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |