简体   繁体   English

UIImageView从左到右更改动画

[英]UIImageView change animation left to right

How do perform a change animation to a UIImageView from left to right. 如何从左到右对UIImageView执行更改动画。 Here is the code I have so far, but this causes a weird flip animation, how can make it a smooth left to right animation like in facebook pitures. 这是我到目前为止的代码,但这会导致怪异的翻转动画,如何使其像Facebook pitures一样从左到右平滑播放。

    UIImage toImage = new UIImage((string)ListOfImages[imageIndex]);
    UIView.Transition(this.ImageView,
                      duration: 1.0,
                      options: UIViewAnimationOptions.TransitionFlipFromLeft,
                      animation: () => this.ImageView.Image = toImage,
                      completion: null);

from left to right do you mean you want to change the UIImageView 's position(Frame)? 从左到右,您是说要更改UIImageView的position(Frame)吗? If so you can try UIView.Animate() : 如果是这样,您可以尝试UIView.Animate()

UIView.Animate(1.0, () =>
{
    this.ImageView.Frame = new CGRect(0, 300, 300, 300);

}, () =>
{
    this.ImageView.Image = toImage;
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 UIImageView动画从左到右 - UIImageView animation from left to right 如何在UIImageView中从左到右(alpha渐变)创建动画淡入 - how to create an animation fade in UIImageView from left to right (alpha gradient) 如何通过从UIViewController向右或向左滑动来更改UIImageView中的图像 - How to change image from UIImageView by sliding right or left from UIViewController 如何在Swift 4中从左到右更改导航动画? - how to change navigation animation to left to right in swift 4? 更改UIImageView的动画图像 - Change the animation images of a UIImageView 从UIImageView的左下角而不是右下角进行页面卷曲动画 - Page curl animation from left bottom corner instead of right bottom corner on UIImageView Xcode:如何从左到右更改情节提要板加载动画 - Xcode : how to change storyboard load animation left to right 如何从左到右更改带有动画的CALayer的宽度? - How to change the width of a CALayer with animation from left to right? 为什么此代码不起作用??? 尝试从UIImageView更改图像(如果向右或向左滑动) - Why this code doens't work??? trying to change image from UIImageView if swiped right or left UIImageView从左到右查看图像 - UIImageView view Image from Left to Right
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM