问题出在了 CardPlayer.swift 上课,特别是在线下 207 ( backgroundIV.frame.size.height = originalFrame.height + ( isPresenting ? move/2 : 0 ) )
CardPlayer.swift
207
backgroundIV.frame.size.height = originalFrame.height + ( isPresenting ? move/2 : 0 )
什么时候 controller 加载 height 的 backgroundIV 被设置为 0 。
controller
height
backgroundIV
0
添加此检查(在线下 207 )应该解决你的问题。
// Issue is here let currentHeight = backgroundIV.frame.size.height // <-- new line to store current value /* this is line #207 */ backgroundIV.frame.size.height = originalFrame.height + ( isPresenting ? move/2 : 0 ) // This is line 207 // This is the check if backgroundIV.frame.size.height <= 0 { print ("heigh is 0") backgroundIV.frame.size.height = currentHeight }
而是这个错误
Failed to set (icon) user defined inspected property on (Cards.CardPlayer): [<Cards.CardPlayer 0x15d7c6a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key icon.
与用户定义运行时属性相关联设置到视图中 Main.storyboard 不属于CardPlayer(你可以删除它,如果你想)
Main.storyboard