2016-06-28 6 views
0

私はスピーディーでiPhone開発の新機能です。最近私は画像を垂直に回転させなければならないトピックに取り組んでいます。スウィフト画像ローテーションで50%の画像を表示

私はこの問題をほぼ解決しましたが、画像が回転していますが、回転している間に画像が50%表示されています。ここにビデオの問題のリンクがあります。また、ここでのコード私は誰もがこの上で私を助けることができる場合、それは非常に参考になる

func animationRotationEffect(view:UIView,animationTime:Float) 
{ 
    UIView.animateWithDuration(NSTimeInterval(animationTime), animations: {() -> Void in 

     /* previously used 
     same result produced as below 
     var animation:CABasicAnimation = CABasicAnimation(keyPath: "transform") 
     animation.toValue = NSValue(CATransform3D:CATransform3DMakeRotation(CGFloat(M_PI), 1, 0, 0)) 

     animation.duration = CFTimeInterval(animationTime) 
     animation.cumulative = false 
     animation.repeatCount = 1 
     view.layer.addAnimation(animation, forKey: nil) 
     */ 


     let animate = CABasicAnimation(keyPath: "transform.rotation.x") 
     animate.duration = CFTimeInterval(animationTime) 
     animate.repeatCount = Float.infinity 
     animate.fromValue = 0.0 
     animate.toValue = Float(M_PI * 2.0) 
     view.layer.addAnimation(animate, forKey: nil) 

    }) 
} 

を使用していhttp://screencast.com/t/VI4yZ0a8Wr

。事前に

おかげで、

ニクソン

答えて

0

多分それは、アニメーションの問題は、UIViewContentMode列挙についてのあなたのUIImageViewにこの

imageView.contentMode = UIViewContentMode.ScaleAspectFit 

詳細情報の側面と内容モードを設定してみませんhere

+0

私はそれが問題ではないと思います。私は既にAspect Fitをストーリーボードから設定しています。 http://screencast.com/t/RfoIvZP5e。また、あなたの解決策を試してもうまくいかなかった。 :( – nixon1333