【发布时间】:2019-06-14 13:00:28
【问题描述】:
我在 UIScrollView 中有一个自定义的 UIView 子类,它(除其他外)覆盖
override var intrinsicContentSize: CGSize {
get {
...
}
}
和(最小的例子):
override func draw(_ rect: CGRect) {
print(rect)
UIColor.white.set() // it has a dark background
UIBezierPath(rect: CGRect(x: 100, y: 100, width: 10, height: 10)).stroke()
}
对于“较小”尺寸的视图,绘图工作得很好,但超过一定的限制就不会再绘图了。
矩形渲染得很好
(0.0, 0.0, 79.5, 7458.5)
(0.0, 0.0, 228.5, 7458.5)
(0.0, 0.0, 149.0, 7738.0)
(0.0, 0.0, 429.0, 7738.0)
但是矩形失败
(0.0, 0.0, 89.5, 8381.0)
(0.0, 0.0, 257.0, 8381.0)
没有错误消息或警告。没有什么能让我知道失败的原因和原因。 UIScrollView 仍然可以滚动。它的内容只是空的。
这发生在模拟的第 5 代 iPad 和模拟的 iPad Pro 9.7" 中。
【问题讨论】: