UIImageView从左到右改变动画

问题描述 投票:0回答:1

如何从左到右对UIImageView执行更改动画。这是我到目前为止的代码,但是这会导致一个奇怪的翻转动画,如何使它成为一个平滑的从左到右的动画,就像在facebook中一样。

    UIImage toImage = new UIImage((string)ListOfImages[imageIndex]);
    UIView.Transition(this.ImageView,
                      duration: 1.0,
                      options: UIViewAnimationOptions.TransitionFlipFromLeft,
                      animation: () => this.ImageView.Image = toImage,
                      completion: null);
ios xamarin.ios uiimageview uiviewanimation uianimation
1个回答
0
投票

从左到右你的意思是你想改变UIImageView的位置(框架)?如果是这样,你可以尝试UIView.Animate()

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

}, () =>
{
    this.ImageView.Image = toImage;
});
© www.soinside.com 2019 - 2024. All rights reserved.