当前位置: 首页>>代码示例>>C#>>正文


C# UIImageView.StartAnimating方法代码示例

本文整理汇总了C#中UIImageView.StartAnimating方法的典型用法代码示例。如果您正苦于以下问题:C# UIImageView.StartAnimating方法的具体用法?C# UIImageView.StartAnimating怎么用?C# UIImageView.StartAnimating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIImageView的用法示例。


在下文中一共展示了UIImageView.StartAnimating方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ViewDidLoad

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			Title = "Images";

			// a simple image
			var img = UIImage.FromBundle ("Images/Icons/50_icon.png");
			imageView = new UIImageView (img) {
				Frame = new CGRect (20, 20, img.CGImage.Width, img.CGImage.Height)
			};
			View.AddSubview (imageView);

			// an animating image
			imgSpinningCircle = new UIImageView {
				Frame = new CGRect (150, 20, 100, 100),
				AnimationRepeatCount = 0,
				AnimationDuration = .5,
				AnimationImages = new UIImage[] {
					UIImage.FromBundle ("Images/Spinning Circle_1.png"),
					UIImage.FromBundle ("Images/Spinning Circle_2.png"),
					UIImage.FromBundle ("Images/Spinning Circle_3.png"),
					UIImage.FromBundle ("Images/Spinning Circle_4.png")
				}
			};

			View.AddSubview (imgSpinningCircle);
			imgSpinningCircle.StartAnimating ();
		}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:29,代码来源:Images2_iPhone.xib.cs

示例2: ViewDidLoad

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			
			Title = "Images";
			
			// a simple image
			imageView1 = new UIImageView (UIImage.FromBundle ("Images/Icons/50_icon.png"));
			imageView1.Frame = new RectangleF (20, 20, imageView1.Image.CGImage.Width, imageView1.Image.CGImage.Height);
			View.AddSubview (imageView1);
			
			// an animating image
			imgSpinningCircle = new UIImageView();
			imgSpinningCircle.AnimationImages = new UIImage[] {
				UIImage.FromBundle ("Images/Spinning Circle_1.png"),
				UIImage.FromBundle ("Images/Spinning Circle_2.png"),
				UIImage.FromBundle ("Images/Spinning Circle_3.png"),
				UIImage.FromBundle ("Images/Spinning Circle_4.png")
			};
			imgSpinningCircle.AnimationRepeatCount = 0;
			imgSpinningCircle.AnimationDuration = .5;
			imgSpinningCircle.Frame = new RectangleF(150, 20, 100, 100);
			View.AddSubview(imgSpinningCircle);
			imgSpinningCircle.StartAnimating ();
		}
开发者ID:Adameg,项目名称:mobile-samples,代码行数:25,代码来源:Images2_iPhone.xib.cs

示例3: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            Title = "Animated ImageView";
            View.BackgroundColor = UIColor.White;

            // an animating image
            animatedCircleImage = new UIImageView();
            animatedCircleImage.AnimationImages = new UIImage[] {
                  UIImage.FromBundle ("Spinning Circle_1.png")
                , UIImage.FromBundle ("Spinning Circle_2.png")
                , UIImage.FromBundle ("Spinning Circle_3.png")
                , UIImage.FromBundle ("Spinning Circle_4.png")
            } ;
            animatedCircleImage.AnimationRepeatCount = 0;
            animatedCircleImage.AnimationDuration = .5;
            animatedCircleImage.Frame = new CGRect(110, 80, 100, 100);
            View.AddSubview(animatedCircleImage);
            animatedCircleImage.StartAnimating ();
        }
开发者ID:yofanana,项目名称:recipes,代码行数:20,代码来源:ImageViewController.cs

示例4: ComparisonView

        public ComparisonView(RectangleF frame)
            : base(frame)
        {
            BackgroundColor = UIColor.White;

            animationImagesImageView = new UIImageView() {
                Frame = new RectangleF(PointF.Empty, new SizeF(40f, 40f)),
                AutoresizingMask = UIViewAutoresizing.FlexibleMargins,
                AnimationImages = new UIImage[] {
                    UIImage.FromBundle("loading_1"),
                    UIImage.FromBundle("loading_2"),
                    UIImage.FromBundle("loading_3"),
                    UIImage.FromBundle("loading_4"),
                },
            };
            animationImagesImageView.AnimationRepeatCount = 0;
            animationImagesImageView.AnimationDuration = 0.5;
            animationImagesImageView.StartAnimating();
            Add(animationImagesImageView);

            basicAnimationImageView = new UIImageView(UIImage.FromBundle("loading_1")) {
                Frame = new RectangleF(PointF.Empty, new SizeF(40f, 40f)),
                AutoresizingMask = UIViewAutoresizing.FlexibleMargins,
                Hidden = true,
            };
            rotationAnimation = CABasicAnimation.FromKeyPath("transform.rotation");
            rotationAnimation.To = NSNumber.FromDouble(Math.PI * 2); // full rotation (in radians)
            rotationAnimation.RepeatCount = int.MaxValue; // repeat forever
            rotationAnimation.Duration = 0.5;
            // Give the added animation a key for referencing it later (e.g., to remove it when it is replaced).
            basicAnimationImageView.Layer.AddAnimation(rotationAnimation, "rotationAnimation");
            Add(basicAnimationImageView);

            // Button overlay to switch between the two versions.
            switchButton = new UIButton();
            switchButton.TouchUpInside += (sender, e) => {
                animationImagesImageView.Hidden = !animationImagesImageView.Hidden;
                basicAnimationImageView.Hidden = !basicAnimationImageView.Hidden;
            };
            Add(switchButton);
        }
开发者ID:patridge,项目名称:SpinnningUIImageView,代码行数:41,代码来源:ComparisonView.cs

示例5: FinishedLaunching

        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            myImages = new List<UIImage> ();

            myImages.Add (UIImage.FromFile ("Images/Icon-72.png"));
            myImages.Add (UIImage.FromFile ("Images/Icon.png"));
            myImages.Add (UIImage.FromFile ("Images/Icon-72.png"));

            myImages.Add (UIImage.FromFile ("Images/Icon-72.png"));

            _bounds = new RectangleF (140, 140, 140, 140);

            myAnimatedView = new UIImageView (_bounds);

            myAnimatedView.AnimationImages = myImages.ToArray();

            if (myImages.Count > 0) {

                Console.WriteLine (myImages.Count);

                myAnimatedView.AnimationDuration = 6.75; // Seconds

                myAnimatedView.AnimationRepeatCount = 0; // 0 = Loops

                myAnimatedView.StartAnimating();

            }

            _root = new RootElement("Littelfuse")
            {
                new Section(""){},
                new Section (myAnimatedView){},
                new Section("Catalogs")
                {
                    new StyledStringElement("Electronics", delegate {

                        CatalogsViewController _web = new CatalogsViewController(_nav,"Electronics");

                        _nav.PushViewController(_web,true);

                        window.RootViewController = _nav;

                        /*alert = new UIAlertView();

                        alert.AddButton("Ok");
                        alert.AddButton("Maybe");
                        alert.AddButton("No");
                        alert.Message = "This could explode the moon";
                        alert.Delegate = new MyAlertViewDelegate();
                        alert.Show();
                        */
                    }),
                    new StyledStringElement("Electrical",delegate {
                        CatalogsViewController _web = new CatalogsViewController(_nav,"Electrical");
                        _nav.PushViewController(_web,true);
                        window.RootViewController = _nav;
                    }),

                    new StyledStringElement("AutoMotive",delegate {
                        CatalogsViewController _web = new CatalogsViewController(_nav,"AutoMotive");
                        _nav.PushViewController(_web,true);
                        window.RootViewController = _nav;
                    }),

                    new StyledStringElement("Check Briefcase",delegate {
                        BriefCaseViewController _briefcase = new BriefCaseViewController(_nav);
                        _nav.PushViewController(_briefcase,true);
                        window.RootViewController = _nav;
                    })

                }
            };
            // If you have defined a view, add it here:
            // window.AddSubview (navigationController.View);

            // make the window visible
            _dvc = new DialogViewController(_root);
            _nav = new UINavigationController(_dvc);

            window.RootViewController = _nav;
            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:satendra4u,项目名称:LittelfuseCatalogs,代码行数:93,代码来源:AppDelegate.cs

示例6: Countdown

        private void Countdown()
        {
            NSTimer timer;

            timer = NSTimer.CreateRepeatingScheduledTimer (TimeSpan.FromSeconds (1), UpdateTimer);

            countdownView = new UIView(this.View.Bounds);

            UIImageView countdownImageView = new UIImageView();
            countdownImageView.AnimationImages = new UIImage[] {
                UIImage.FromBundle("images/5"),
                UIImage.FromBundle("images/4"),
                UIImage.FromBundle("images/3"),
                UIImage.FromBundle("images/2"),
                UIImage.FromBundle("images/1"),
                UIImage.FromBundle("images/go")
            };
            countdownImageView.AnimationRepeatCount = 1;
            countdownImageView.AnimationDuration = 2.0;

            countdownImageView.Frame = new RectangleF(122.5f, 202.5f, 75, 75);

            countdownView.AddSubview(countdownImageView);
            countdownView.BackgroundColor = UIColor.Black;

            this.View.AddSubview(countdownView);

            countdownImageView.StartAnimating();
        }
开发者ID:dan-pennyfarthingapps,项目名称:TestCountdown,代码行数:29,代码来源:TestCountdownViewController.cs

示例7: FinishedLaunching

        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // create a new window instance based on the screen size

            window = new UIWindow (UIScreen.MainScreen.Bounds);

            myImages = new List<UIImage> ();

            myImages.Add (UIImage.FromFile ("Images/Icon-72.png"));
            myImages.Add (UIImage.FromFile ("Images/Icon.png"));
            myImages.Add (UIImage.FromFile ("Images/Icon-72.png"));

            myImages.Add (UIImage.FromFile ("Images/Icon-72.png"));

            _bounds = new RectangleF (140, 140, 140, 140);

            myAnimatedView = new UIImageView (_bounds);

            myAnimatedView.AnimationImages = myImages.ToArray();

            if (myImages.Count > 0) {

                Console.WriteLine (myImages.Count);

                myAnimatedView.AnimationDuration = 6.75; // Seconds

                myAnimatedView.AnimationRepeatCount = 0; // 0 = Loops

                myAnimatedView.StartAnimating();

            }

            _rootViewController = new DialogViewController(new RootElement("Littelfuse") {

                    new Section() {},
                    new Section (myAnimatedView){},
                    new Section("Catalogs")
                    {
            //						new RootElement("Test", delegate
            //						{
                        new RootElement("Catalogs") {
                            showSublements()

                        }
            //						})
                    },

                    JsonElement.FromFile("element.json")

                    /*new Section ("Catalogs") {
                        new RootElement ("Electronics") {
                            new Section () {
                                new HtmlElement("Electronics 1",ns),
                                new HtmlElement("Electronics 2",ns),
                                new HtmlElement("Electronics 3",ns),
                                new HtmlElement("Electronics 4",ns),
                                new HtmlElement("Electronics 5",ns),
                                new HtmlElement("Electronics 6",ns),
                                new HtmlElement("Electronics 7",ns),
                                new HtmlElement("Electronics 8",ns),
                                new HtmlElement("Electronics 9",ns),
                                new HtmlElement("Electronics 10",ns)
                            }

                        },
                        new RootElement("Electrical")
                        {
                            new Section () {

                                new HtmlElement("Electrical 1",ns),
                                new HtmlElement("Electrical 2",ns),
                                new HtmlElement("Electrical 3",ns),
                                new HtmlElement("Electrical 4",ns),
                                new HtmlElement("Electrical 5",ns),
                                new HtmlElement("Electrical 6",ns),
                                new HtmlElement("Electrical 7",ns),
                                new HtmlElement("Electrical 8",ns),
                                new HtmlElement("Electrical 9",ns),
                                new HtmlElement("Electrical 10",ns)

                            }

                        }

                    }*/

                }
            );

            _navController = new UINavigationController(_rootViewController);

             window.RootViewController = _navController;

//.........这里部分代码省略.........
开发者ID:satendra4u,项目名称:LFCatalogs,代码行数:101,代码来源:AppDelegate.cs

示例8: Animate

 private void Animate(UIImageView _imgView, int _min = 5, int _max = 10)
 {
     _imgView.StartAnimating();
       Sys.Timeout(Sys.Random.Next(_min,_max), () => Animate(_imgView, _min, _max));
 }
开发者ID:nirinchev,项目名称:CuriousWeather,代码行数:5,代码来源:WeatherViewController.cs


注:本文中的UIImageView.StartAnimating方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。