Closed zekunyan closed 6 years ago
https://github.com/alibaba/VirtualView-iOS/blob/290e44426e00af75d2fad7e95ef27e80b5daaa04/VirtualView/View/VVGridView.m#L440
- (void)setUpdateDelegate:(id<VVWidgetAction>)delegate{ if (self.drawLayer==nil) { self.drawLayer = [VVLayer layer]; self.drawLayer.drawsAsynchronously = YES; self.drawLayer.contentsScale = [[UIScreen mainScreen] scale]; self.drawLayer.delegate = (id<CALayerDelegate>)self; [self.gridContainer.layer addSublayer:self.drawLayer]; } for (VVViewObject* subObj in self.subViews) { subObj.updateDelegate = (id<VVWidgetAction>)self.gridContainer; } }
其中if (self.drawLayer==nil)永远为NO,因为继承的VVLayout会保证self.drawLayer有值
if (self.drawLayer==nil)
self.drawLayer
然后
subObj.updateDelegate = (id<VVWidgetAction>)self.gridContainer
非常危险,因为self.gridContainer没有实现VVWidgetAction
self.gridContainer
VVWidgetAction
同理VVPageView也有这个问题
收到,这是 Layout 重构进行到一半导致的 bug,会在重构中尽快解决。
1ddad863080dc325ee1645882f7857c8cb64f28e 将 drawLayer 稍微改进了下,不过不确定是否完全解决了此问题
release 1.2.2 已解决
https://github.com/alibaba/VirtualView-iOS/blob/290e44426e00af75d2fad7e95ef27e80b5daaa04/VirtualView/View/VVGridView.m#L440
其中
if (self.drawLayer==nil)
永远为NO,因为继承的VVLayout会保证self.drawLayer
有值然后
非常危险,因为
self.gridContainer
没有实现VVWidgetAction