Open a-v-ebrahimi opened 7 years ago
I found same issue, but can't resolve this.
var kenBurns = KenBurnsImageView();
override func viewDidLoad() {
super.viewDidLoad()
let image = #imageLiteral(resourceName: "loginBackground1")
kenBurns = newKenBurnsImageView(image: image)
self.view.addSubview(kenBurns)
}
func newKenBurnsImageView(image: UIImage) -> KenBurnsImageView {
let ken = KenBurnsImageView()
ken.setImage(image)
ken.zoomIntensity = 1.5
ken.setDuration(min: 5, max: 13)
ken.frame = view.bounds
ken.startAnimating()
return ken
}
I can't yet resolve it but i used a simple trick as i'm using SwiftUI
ZStack {
Image("my_asset_image")
.resizable()
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 240, alignment: .top)
CustomKenBurnsImageView(imageName: "my_asset_image")
.frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 240, alignment: .top)
}
And during the delay i have a static image in the background. And the EndUser does't experiment the 4 seconds delay
I put in a quick/hacky workaround resolving the crash related to the queue and the delay on initial animation. PR is pending. You can find it here in the meantime: https://github.com/Antair/KenBurns/commit/e14510a09e20957723e6ab0dfbd0a60474b9143b
Initially KenBurnsImageView shows nothing, but after a while starts to animate.