示例#1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            FLAnimatedImage     image     = new FLAnimatedImage(NSData.FromUrl(NSUrl.FromString("https://cloud.githubusercontent.com/assets/1567433/10417835/1c97e436-7052-11e5-8fb5-69373072a5a0.gif")));
            FLAnimatedImageView imageView = new FLAnimatedImageView()
            {
                AnimatedImage = image,
                Frame         = new CoreGraphics.CGRect(100, 100, 200, 200)
            };

            this.View.AddSubview(imageView);
            // Perform any additional setup after loading the view, typically from a nib.
        }
示例#2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            nfloat centerX = this.View.Center.X - 100;
            nfloat centerY = this.View.Center.Y - 100;

            FLAnimatedImage animatedImage = FLAnimatedImage.AnimatedImageWithGIFData(
                NSData.FromFile(NSBundle.MainBundle.PathForResource("gattino", "gif")));

            FLAnimatedImageView imageView = new FLAnimatedImageView();

            imageView.AnimatedImage = animatedImage;
            imageView.Frame         = new CGRect(centerX, centerY, 200, 200);

            this.View.AddSubview(imageView);
        }
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            View.BackgroundColor = UIColor.FromWhiteAlpha(0.95f, 1.0f);
            var imageView = new FLAnimatedImageView();

            imageView.ContentMode   = UIViewContentMode.ScaleAspectFit;
            imageView.ClipsToBounds = true;

            View.Add(imageView);
            imageView.Frame = new CoreGraphics.CGRect(0.0f, 0.0f, View.Bounds.Size.Width, View.Bounds.Size.Height);

            NSUrl           url           = NSBundle.MainBundle.GetUrlForResource("rock", "gif");
            NSData          data          = NSData.FromUrl(url);
            FLAnimatedImage animatedImage = FLAnimatedImage.AnimatedImageWithGIFData(data);

            imageView.AnimatedImage = animatedImage;
        }