![](/img/trans.png)
[英]How to link third party dll from class library in Xamarin.iOS when using VS2012 and Build Host
[英]How to use gif with UIImageView in Xamarin.iOS without using third party library?
我想在UIImageView中加载gif图像。 我尝试将其与FLAnimatedImage一起使用,但无法正常工作。 我已经在情节提要中使用了imageview并将gif添加到资源中。
如果要使用UIImageView加载gif图像,我会找到一篇文章,您可以看一下:
https://montemagno.com/animated-gif-uiimageview-in-xamarinios/
如果您尝试使用单个图像创建gif,则将变得更加容易,如您在此处看到的。 当您将本地代码从此处转换为C#时,您会得到
UIImageView gifView = new UIImageView();
gifView.AnimationImages = new UIImage[] {
UIImage.FromBundle("Image1.png"),
UIImage.FromBundle("Image2.png"),
UIImage.FromBundle("Image3.png"),
UIImage.FromBundle("Image4.png")
};
gifView.AnimationRepeatCount = 0; // Repeat forever.
gifView.AnimationDuration = 1.0; // Every 1s.
gifView.StartAnimating();
gifView.View.Frame = new CoreGraphics.CGRect(0, 20, this.View.Bounds.Size.Width, 180); // size of the animation
this.View.AddSubview(gifView);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.