uiimageview - Fade in/out Image in UIIamgeView happens with no duration -
i have uiiamge created programmatically in viewdidload of detailviewcontroller. .transitioncrossdissolve between current image image. problem once detailviewcontroller displayed switch happens right away no matter duration. never see first image. using following code.
let rect = cgrect(x: 0, y: uiapplication.shared.statusbarframe.height, width: view.frame.size.width, height: view.frame.size.height / 3.0) let imageview = uiimageview(frame: rect) imageview.image = #imageliteral(resourcename: "head1") imageview.contentmode = .scaleaspectfill imageview.clipstobounds = true view.addsubview(imageview) uiview.transition(with: imageview, duration: 16.0, options: .transitioncrossdissolve, animations: { imageview.image = #imageliteral(resourcename: "head3") }, completion: nil)
try start animation in viewdidappear delegate. think thats problem.
Comments
Post a Comment