From e3e9d36f56e56509cec2942e77f8b25cd5c221ec Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Wed, 25 May 2016 10:07:34 -0700 Subject: [PATCH 1/2] Fix image sometimes appearing with black background or completely disappearing in ASImageNode --- AsyncDisplayKit/ASImageNode.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/AsyncDisplayKit/ASImageNode.mm b/AsyncDisplayKit/ASImageNode.mm index 2847e4c9f3..87515ae5d6 100644 --- a/AsyncDisplayKit/ASImageNode.mm +++ b/AsyncDisplayKit/ASImageNode.mm @@ -94,6 +94,7 @@ self.contentsScale = ASScreenScale(); self.contentMode = UIViewContentModeScaleAspectFill; self.opaque = NO; + self.backgroundColor = [UIColor clearColor]; _cropEnabled = YES; _forceUpscaling = NO; From 73ce8c148a9778597e94b3e8c2fd7278b5405b90 Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Thu, 26 May 2016 10:01:12 -0700 Subject: [PATCH 2/2] Add comment for setting the backgroundColor in ASImageNode --- AsyncDisplayKit/ASImageNode.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AsyncDisplayKit/ASImageNode.mm b/AsyncDisplayKit/ASImageNode.mm index 87515ae5d6..cd2dbf0036 100644 --- a/AsyncDisplayKit/ASImageNode.mm +++ b/AsyncDisplayKit/ASImageNode.mm @@ -94,6 +94,10 @@ self.contentsScale = ASScreenScale(); self.contentMode = UIViewContentModeScaleAspectFill; self.opaque = NO; + + // If no backgroundColor is set to the image node and it's a subview of UITableViewCell, UITableView is setting + // the opaque value of all subviews to YES if highlighting / selection is happening and does not set it back to the + // initial value. With setting a explicit backgroundColor we can prevent that change. self.backgroundColor = [UIColor clearColor]; _cropEnabled = YES;