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


C# UIActivityIndicatorView.StopAnimating方法代码示例

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


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

示例1: SetImage

		public async void SetImage (string url)
		{
			UIImage image = null;

			if (!images.ContainsKey(url)) {

				var spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray);

				spinner.StartAnimating();

				spinner.Center = new CGPoint (PhotoView.Frame.Width / 2f, PhotoView.Frame.Height / 2f);

				ContentView.AddSubview(spinner);

				var imageData = await ResourceLoader.DefaultLoader.GetImageData(url);

				image = UIImage.LoadFromData(NSData.FromArray(imageData));

				spinner.StopAnimating();
				spinner.RemoveFromSuperview();

				images.Add(url, image);
			
			} else {
			
				image = images[url];
			}

			PhotoView.ContentMode = UIViewContentMode.ScaleAspectFill;
			PhotoView.Image = image;
		}
开发者ID:RobGibbens,项目名称:Coffee-Filter,代码行数:31,代码来源:PhotoCell.cs

示例2: ViewDidLoad

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

            var source = new MySource(VM, TableView,
                EventCell.Key, EventCell.Key);
            TableView.RowHeight = 66;
            TableView.Source = source;

            var refreshControl = new MvxUIRefreshControl{Message = "Loading..."};
            this.RefreshControl = refreshControl;

            var set = this.CreateBindingSet<EventsView, EventsViewModel>();
            set.Bind(source).To(vm => vm.Events);
            set.Bind(refreshControl).For(r => r.IsRefreshing).To(vm => vm.IsBusy);
            set.Bind(refreshControl).For(r => r.RefreshCommand).To(vm => vm.RefreshCommand);
            set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.GoToEventCommand);
            set.Apply();
            var spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray);
            spinner.Frame = new RectangleF (0, 0, 320, 66);

            TableView.TableFooterView = spinner;
            //if isn't first load show spinner when busy
            VM.IsBusyChanged = (busy) => {
                if(busy && VM.Events.Count > 0)
                    spinner.StartAnimating();
                else
                    spinner.StopAnimating();
            };
            TableView.ReloadData();
            NavigationItem.RightBarButtonItem = new UIBarButtonItem ("Stats", UIBarButtonItemStyle.Plain, delegate {
                ((EventsViewModel)ViewModel).ExecuteGoToStatsCommand();
            });
        }
开发者ID:Cheesebaron,项目名称:MeetupManager,代码行数:34,代码来源:EventsView.cs

示例3: LoadUrl

		public static async Task LoadUrl(this UIImageView imageView, string url)
		{	
			if (string.IsNullOrEmpty (url))
				return;
			var progress = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge)
			{
				Center = new PointF(imageView.Bounds.GetMidX(), imageView.Bounds.GetMidY()),
			};
			imageView.AddSubview (progress);

		
			var t = FileCache.Download (url);
			if (t.IsCompleted) {
				imageView.Image = UIImage.FromFile(t.Result);
				progress.RemoveFromSuperview ();
				return;
			}
			progress.StartAnimating ();
			var image = UIImage.FromFile(await t);

			UIView.Animate (.3, 
				() => imageView.Image = image,
				() => {
					progress.StopAnimating ();
					progress.RemoveFromSuperview ();
				});
		}
开发者ID:AsiyaLearn,项目名称:xamarin-store-app,代码行数:27,代码来源:UIImageExtensions.cs

示例4: BeginDownloadingPOC

		public async void BeginDownloadingPOC (UIViewController controller, UIImageView imageView, UIActivityIndicatorView acIndicator, string imagePath, bool isCache)
		{
			if (acIndicator != null)
				acIndicator.StartAnimating ();

			UIImage data = null;
			if (imagePath != null)
				data = await GetImageData (imagePath, isCache);
				
			CGPoint center = imageView.Center;

			UIImage finalImage = null;
			if (data != null) {
				finalImage = MUtils.scaledToWidth (data, imageView.Frame.Width * 2);
				imageView.Frame = new CGRect (0.0f, 0.0f, finalImage.Size.Width / 2, finalImage.Size.Height / 2);
			}

			imageView.Image = getImageFrom (finalImage, "noimage.png");
			imageView.Center = center;

			if (acIndicator != null) {
				acIndicator.StopAnimating ();
				acIndicator.Color = UIColor.Clear;
			}
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:25,代码来源:TCAsyncImage.cs

示例5: ViewDidLoad

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

			Title = "Live Chat";

			var menuButtonItem = new UIBarButtonItem (UIImage.FromBundle ("Menu"), UIBarButtonItemStyle.Plain, delegate {
				Navigation.ToggleMenu ();
			});

			menuButtonItem.TintColor = Theme.PrimaryColor;
			NavigationItem.LeftBarButtonItem = menuButtonItem;
			NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes (){ 
				Font = UIFont.PreferredHeadline,
				ForegroundColor = Theme.PrimaryColor
			};
			var spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray);
			spinner.Frame = new CGRect(0, 0, 25, 25);
			spinner.Tag = 1;
			spinner.Color = Theme.PrimaryColor;

			NavigationItem.RightBarButtonItem = new UIBarButtonItem (spinner);

			LiveChatView.LoadStarted += (object sender, EventArgs e) => spinner.StartAnimating ();
			LiveChatView.LoadFinished += (object sender, EventArgs e) => spinner.StopAnimating ();

			LiveChatView.LoadRequest (new NSUrlRequest(new NSUrl("https://scrollback.io/xhackers/all")));
		}
开发者ID:codeRuth,项目名称:Ask-X,代码行数:28,代码来源:LiveChatViewController.cs

示例6: ViewDidLoad

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

            var activityIndicator = new UIActivityIndicatorView (new CoreGraphics.CGRect (0, 0, 20, 20));
            activityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White;
            activityIndicator.HidesWhenStopped = true;
            NavigationItem.LeftBarButtonItem = new UIBarButtonItem (activityIndicator);

            var getMonkeysButton = new UIBarButtonItem ();
            getMonkeysButton.Title = "Get";
            getMonkeysButton.Clicked += async (object sender, EventArgs e) => {
                activityIndicator.StartAnimating();
                getMonkeysButton.Enabled = false;

                await ViewModel.GetMonkeysAsync();
                TableViewMonkeys.ReloadData();

                getMonkeysButton.Enabled = true;
                activityIndicator.StopAnimating();
            };
            NavigationItem.RightBarButtonItem = getMonkeysButton;

            TableViewMonkeys.WeakDataSource = this;
        }
开发者ID:rogeriorrodrigues,项目名称:iOS9Samples,代码行数:25,代码来源:ViewController.cs

示例7: ViewDidLoad

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

            var source = new MySource(VM, TableView,
                GroupCell.Key, GroupCell.Key);
            TableView.RowHeight = 66;
            TableView.Source = source;

            var refreshControl = new MvxUIRefreshControl{Message = "Loading..."};
            this.RefreshControl = refreshControl;

            var set = this.CreateBindingSet<GroupsView, GroupsViewModel>();
            set.Bind(source).To(vm => vm.Groups);
            set.Bind(refreshControl).For(r => r.IsRefreshing).To(vm => vm.IsBusy);
            set.Bind(refreshControl).For(r => r.RefreshCommand).To(vm => vm.RefreshCommand);
            set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.GoToGroupCommand);
            set.Apply();

            TableView.ReloadData();
            var spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray);
            spinner.Frame = new RectangleF (0, 0, 320, 66);
            //if isn't first time show spinner when busy
            TableView.TableFooterView = spinner;
            VM.IsBusyChanged = (busy) => {
                if(busy && VM.Groups.Count > 0)
                    spinner.StartAnimating();
                else
                    spinner.StopAnimating();
            };
        }
开发者ID:Cheesebaron,项目名称:MeetupManager,代码行数:31,代码来源:GroupsView.cs

示例8: LoadMoreElement

		public LoadMoreElement (string normalCaption, string loadingCaption, Action<LoadMoreElement> tapped, UIFont font, UIColor textColor) : base ("")
		{
			this.NormalCaption = normalCaption;
			this.LoadingCaption = loadingCaption;
			this.tapped = tapped;
			this.font = font;
			
			cell = new UITableViewCell (UITableViewCellStyle.Default, "loadMoreElement");
			
			activityIndicator = new UIActivityIndicatorView () {
				ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray,
				Hidden = true
			};
			activityIndicator.StopAnimating ();
			
			caption = new UILabel () {
				Font = font,
				Text = this.NormalCaption,
				TextColor = textColor,
				BackgroundColor = UIColor.Clear,
				TextAlignment = UITextAlignment.Center,
				AdjustsFontSizeToFitWidth = false,
			};
			
			Layout ();
			
			cell.ContentView.AddSubview (caption);
			cell.ContentView.AddSubview (activityIndicator);
		}
开发者ID:jogibear9988,项目名称:MonoTouch.Dialog,代码行数:29,代码来源:LoadMoreElement.cs

示例9: BeginDownloadingAvatar

		public async void BeginDownloadingAvatar (UIViewController controller, UIImageView imageView, UIActivityIndicatorView acIndicator, string imagePath, bool isCache)
		{

			if (acIndicator != null)
				acIndicator.StartAnimating ();

			UIImage image = null;
			if (imagePath != null)
				image = await GetImageData (imagePath, isCache);

			imageView.Image = getImageFrom (image);

			if (acIndicator != null) {
				acIndicator.StopAnimating ();
				acIndicator.Color = UIColor.Clear;
			}
		}
开发者ID:borain89vn,项目名称:demo2,代码行数:17,代码来源:TCAsyncImage.cs

示例10: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.AutosizesSubviews = true;

            _imgView = new UIImageView();
            _imgView.Layer.CornerRadius = imageSize / 2;
            _imgView.Layer.MasksToBounds = true;
            _imgView.Image = Images.Avatar;
            _imgView.Layer.BorderWidth = 2f;
            _imgView.Layer.BorderColor = UIColor.White.CGColor;
            Add(_imgView);

            _statusLabel = new UILabel();
            _statusLabel.TextAlignment = UITextAlignment.Center;
            _statusLabel.Font = UIFont.FromName("HelveticaNeue", 13f);
            _statusLabel.TextColor = UIColor.FromWhiteAlpha(0.9f, 1.0f);
            Add(_statusLabel);

            _activityView = new UIActivityIndicatorView { HidesWhenStopped = true };
            _activityView.Color = UIColor.FromWhiteAlpha(0.85f, 1.0f);
            Add(_activityView);

            View.BackgroundColor = Theme.CurrentTheme.PrimaryColor;

            OnActivation(d =>
            {
                d(ViewModel.Bind(x => x.Avatar).Subscribe(UpdatedImage));
                d(ViewModel.Bind(x => x.Status).Subscribe(x => _statusLabel.Text = x));
                d(ViewModel.GoToMenuCommand.Subscribe(GoToMenu));
                d(ViewModel.GoToAccountsCommand.Subscribe(GoToAccounts));
                d(ViewModel.GoToLoginCommand.Subscribe(GoToNewAccount));
                d(ViewModel.Bind(x => x.IsLoggingIn).Subscribe(x =>
                {
                    if (x)
                        _activityView.StartAnimating();
                    else
                        _activityView.StopAnimating();

                    _activityView.Hidden = !x;
                }));
            });
        }
开发者ID:xNUTs,项目名称:CodeBucket,代码行数:43,代码来源:StartupViewController.cs

示例11: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.AutosizesSubviews = true;

            _imgView = new UIImageView();
            _imgView.Layer.CornerRadius = imageSize / 2;
            _imgView.Layer.MasksToBounds = true;
            _imgView.Image = Images.Avatar;
            _imgView.TintColor = TextColor;
            _imgView.Layer.BorderWidth = 2f;
            _imgView.Layer.BorderColor = UIColor.White.CGColor;
            Add(_imgView);

            _statusLabel = new UILabel();
            _statusLabel.TextAlignment = UITextAlignment.Center;
            _statusLabel.Font = UIFont.FromName("HelveticaNeue", 13f);
            _statusLabel.TextColor = TextColor;
            Add(_statusLabel);

            _activityView = new UIActivityIndicatorView() { HidesWhenStopped = true };
            _activityView.Color = SpinnerColor;
            Add(_activityView);

            View.BackgroundColor = Theme.CurrentTheme.PrimaryColor;
           
			var vm = (StartupViewModel)ViewModel;
			vm.Bind(x => x.IsLoggingIn, x =>
			{
				if (x)
				{
                    _activityView.StartAnimating();
				}
				else
				{
                    _activityView.StopAnimating();
				}
			});

            vm.Bind(x => x.Avatar, UpdatedImage);
            vm.Bind(x => x.Status, x => _statusLabel.Text = x);

        }
开发者ID:Mikoj,项目名称:CodeBucket,代码行数:43,代码来源:StartupView.cs

示例12: LoadMoreElement

		public LoadMoreElement(string normalCaption, string loadingCaption, ICommand command) : base (normalCaption)
		{
			NormalCaption = normalCaption;
			LoadingCaption = loadingCaption;
			Command = command;
			
			TextFont = UIFont.BoldSystemFontOfSize(15f);
			TextAlignment = UITextAlignment.Center;

			_ActivityIndicator = new UIActivityIndicatorView()
			{
				ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White,
				Hidden = true,
				Tag = 1,
				Frame = new RectangleF(indicatorSize * 2, pad, indicatorSize, indicatorSize)
			};

			_ActivityIndicator.StopAnimating();
		}
开发者ID:anujb,项目名称:MonoMobile.MVVM,代码行数:19,代码来源:LoadMoreElement.cs

示例13: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            View.AutosizesSubviews = true;

            _imgView = new UIImageView();
            _imgView.TintColor = Theme.CurrentTheme.PrimaryColor;
            _imgView.Layer.CornerRadius = imageSize / 2;
            _imgView.Layer.MasksToBounds = true;
            Add(_imgView);

            _statusLabel = new UILabel();
            _statusLabel.TextAlignment = UITextAlignment.Center;
            _statusLabel.Font = UIFont.FromName("HelveticaNeue", 13f);
            _statusLabel.TextColor = UIColor.FromWhiteAlpha(0.34f, 1f);
            Add(_statusLabel);

            _activityView = new UIActivityIndicatorView();
            _activityView.Color = UIColor.FromRGB(0.33f, 0.33f, 0.33f);
            Add(_activityView);

            View.BackgroundColor = UIColor.FromRGB (221, 221, 221);

            OnActivation(d =>
            {
                d(ViewModel.Bind(x => x.ImageUrl).Subscribe(UpdatedImage));
                d(ViewModel.Bind(x => x.Status).Subscribe(x => _statusLabel.Text = x));
                d(ViewModel.GoToMenu.Subscribe(GoToMenu));
                d(ViewModel.GoToAccounts.Subscribe(GoToAccounts));
                d(ViewModel.GoToNewAccount.Subscribe(GoToNewAccount));
                d(ViewModel.Bind(x => x.IsLoggingIn).Subscribe(x =>
                {
                    if (x)
                        _activityView.StartAnimating();
                    else
                        _activityView.StopAnimating();

                    _activityView.Hidden = !x;
                }));
            });
        }
开发者ID:GitWatcher,项目名称:CodeHub,代码行数:41,代码来源:StartupViewController.cs

示例14: ViewDidLoad

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

            var addNewMemberButton = new UIBarButtonItem (UIBarButtonSystemItem.Add);

            var source = new MvxDeleteSimpleTableViewSource((IRemove)ViewModel, MainTableView, MemberCell.Key, MemberCell.Key);
            MainTableView.RowHeight = 66;
            MainTableView.Source = source;
            MainTableView.WeakDataSource = this;

            var refreshControl = new MvxUIRefreshControl{Message = "Loading..."};
            MainTableView.AddSubview (refreshControl);

            var set = this.CreateBindingSet<EventView, EventViewModel>();
            set.Bind(source).To(vm => vm.Members);
            set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.CheckInCommand);
            set.Bind(refreshControl).For(r => r.IsRefreshing).To(vm => vm.IsBusy);
            set.Bind(refreshControl).For(r => r.RefreshCommand).To(vm => vm.RefreshCommand);
            set.Bind (this).For("Title").To (vm => vm.EventName);
            set.Bind (ButtonPickWinner).To (vm => vm.SelectWinnerCommand);
            set.Bind (ButtonRSVPNumber).For ("Title").To (vm => vm.RSVPCount);
            set.Bind (addNewMemberButton).To (vm => vm.AddNewUserCommand);
            set.Apply();

            MainTableView.ReloadData();
            var spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.Gray);
            spinner.Frame = new RectangleF (0, 0, 320, 66);

            MainTableView.TableFooterView = spinner;
            VM.IsBusyChanged = (busy) => {
                if(busy && VM.Members.Count > 0)
                    spinner.StartAnimating();
                else
                    spinner.StopAnimating();
            };
            NavigationItem.RightBarButtonItem = addNewMemberButton;

            //MainTableView.Source.
        }
开发者ID:rferolino,项目名称:MeetupManager,代码行数:40,代码来源:EventView.cs

示例15: ViewWillAppear

        public override void ViewWillAppear(bool animated)
        {
            spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
            spinner.Center = new PointF (160, 160);
            spinner.HidesWhenStopped = true;
            View.AddSubview (spinner);
            spinner.StartAnimating ();
            TableView.Hidden = true;

            var button = new UIBarButtonItem ("Back", UIBarButtonItemStyle.Plain, null);
            var custom = new UIButton (new RectangleF (0, 0, 26, 15));
            custom.SetBackgroundImage(UIImage.FromFile("./Assets/back.png"), UIControlState.Normal);
            custom.TouchUpInside += (sender, e) => NavigationController.PopViewControllerAnimated (true);
            button.CustomView = custom;

            this.NavigationItem.LeftBarButtonItem = button;

            var request = new RestRequest ();
            request.RequestFinished += (object sender, RequestEndedArgs e) => {
                var data = (AddContentModel)JsonConvert.DeserializeObject(e.Result, typeof(AddContentModel));
                InvokeOnMainThread(delegate {
                    AppDelegate.SubCategories = data;
                    var all = new AddContentItem();
                    all.Name = "All from " + data.ParentCategory.Name;
                    all.HasChildren = false;
                    all.Checked = ParentChecked;
                    all.Id = data.ParentCategory.Id;
                    AppDelegate.SubCategories.Categories.Insert(0, all);
                    TableView.ReloadData();
                    TableView.Hidden = false;
                    spinner.StopAnimating();
                });
            };
            request.Send (string.Format(RequestConfig.SubCategories, CategoryId), "GET");

            this.TableView.Source = new PreferencesSubControllerSource ();
            this.TableView.AllowsMultipleSelection = true;
        }
开发者ID:jgrozdanov,项目名称:mono-sport,代码行数:38,代码来源:PreferencesSubController.cs


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