Closed yuriandryu closed 4 years ago
Instead of complaining, try to fix it yourself ;)
I tried, it didn’t work. I don’t have one problem, please solve this problem as soon as possible.
@yuriandryu I forked the repo, then replaced the superclass to UIView
. Removed the override
-s and the calls for super.image
and basically fixed the errors in the class. Yes, I lost the ability to attach Kingfisher to that UIImageView, or the RxCocoa .rx.image
property, but still, it works now.
I respect. did as you said, everything works now! Thanks bro
Rather than remove kf etc UIImageView support I worked around this by ensuring the super image wasn't one that can be seen. So I updated updateLayout to set the super image to a transparent image like so; works fine for now.
if #available(iOS 11, *) { super.image = UIImage(named: "transparent_image") }
@neilkachu Tried your solution unsuccessfully 😢. Is transparent_image
just a place holder, or it is an actual existing transparent image? this is suppose to replace the = nil
.
@neilkachu Your solution doesn't work for me unfortunately. I have a transparent asset but still double images.
Im not sure if its a bug, I would have thought that setting the layers contents to nil should in theory remove the image however setting the layers contents to a CALayer works fine. e.g.
if #available(iOS 13, *) {
self.layer.contents = CALayer()
} else if #available(iOS 11, *) {
super.image = nil
} else {
layer.contents = nil
}
@neilkachu Tried your solution unsuccessfully 😢. Is
transparent_image
just a place holder, or it is an actual existing transparent image? this is suppose to replace the= nil
.
Yes, just a 1px transparent image in the Assets lib so not sure why it's not working your end, that was the only change I ended up with., @christoff-1992 's solution looks cleaner, I'd re-try with that.
Fixed removing if #available(iOS 11, *) { super.image = nil }
everywhere (didMoveToSuperview,didMoveToWindow,updatelayout, etc)
This fix also for iOS11.
You need only to invalidate layer: layer.contents = nil
I have the same problem! If the image is aligned, 2 images appear, one aligned and the second in the center of the original. Please pack it as soon as possible!