简体   繁体   中英

UIImageView change animation left to right

How do perform a change animation to a UIImageView from left to right. 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.

    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)? If so you can try UIView.Animate() :

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM