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


C# UIActivityIndicatorView.StartAnimating方法代码示例

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


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

示例1: WillDisplay

		async public override void WillDisplay(UITableView tableView, UITableViewCell cell, NSIndexPath indexPath)
		{
			if (cell.RespondsToSelector(new ObjCRuntime.Selector("setSeparatorInset:")))
			{
				cell.SeparatorInset = UIEdgeInsets.Zero;
			}
			if (cell.RespondsToSelector(new ObjCRuntime.Selector("setPreservesSuperviewLayoutMargins:")))
			{
				cell.PreservesSuperviewLayoutMargins = false;
			}
			if (cell.RespondsToSelector(new ObjCRuntime.Selector("setLayoutMargins:")))
			{
				cell.LayoutMargins = UIEdgeInsets.Zero;
			}

			if (Master.TailFetchingEnabled && indexPath.Row == Master.GetTableItemCount() - 1 && !Master.Fetching && Master.GetTableItemCount() > 0 && Master.NextAllowedTailFetch < DateTime.UtcNow)
			{
				UIView FooterLoadingView = new UIView(new CoreGraphics.CGRect(0, 0, UIScreen.MainScreen.Bounds.Size.Width, ((AppDelegate)UIApplication.SharedApplication.Delegate).TabBarController.TabBar.Frame.Size.Height + 60));
				UIActivityIndicatorView ai = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.Gray);
				ai.Frame = new CoreGraphics.CGRect(UIScreen.MainScreen.Bounds.Size.Width / 2 - 15, 15, 30, 30);
				ai.StartAnimating();
				FooterLoadingView.AddSubview(ai);
				tableView.TableFooterView = FooterLoadingView;
				Master.Offset = Master.GetTableItemCount();//Master.Offset + Master.Count;
				await Master.FetchTableData();
			}
		}
开发者ID:natevarghese,项目名称:XamarinTen,代码行数:27,代码来源:BaseTableViewDelegate.cs

示例2: ViewDidLoad

		public override void ViewDidLoad ()
		{
            loadingBg = new UIView (this.View.Frame) { 
                BackgroundColor = UIColor.Black, 
                AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight 
            };
            loadingView = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge) {
                AutoresizingMask = UIViewAutoresizing.FlexibleMargins
            };
			loadingView.Frame = new CGRect ((this.View.Frame.Width - loadingView.Frame.Width) / 2, 
				(this.View.Frame.Height - loadingView.Frame.Height) / 2,
				loadingView.Frame.Width, 
				loadingView.Frame.Height);
			
			loadingBg.AddSubview (loadingView);
			View.AddSubview (loadingBg);
			loadingView.StartAnimating ();

			scannerView = new AVCaptureScannerView(new CGRect(0, 0, this.View.Frame.Width, this.View.Frame.Height));
			scannerView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
			scannerView.UseCustomOverlayView = this.Scanner.UseCustomOverlay;
			scannerView.CustomOverlayView = this.Scanner.CustomOverlay;
			scannerView.TopText = this.Scanner.TopText;
			scannerView.BottomText = this.Scanner.BottomText;
			scannerView.CancelButtonText = this.Scanner.CancelButtonText;
			scannerView.FlashButtonText = this.Scanner.FlashButtonText;
            scannerView.OnCancelButtonPressed += () => {
                Scanner.Cancel ();
            };

			this.View.AddSubview(scannerView);
			this.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
		}
开发者ID:rpmendes2017,项目名称:ZXing.Net.Mobile,代码行数:33,代码来源:AVCaptureScannerViewController.cs

示例3: Draw

		/// <summary>
		/// this is where we do the meat of creating our alert, which includes adding 
		/// controls, etc.
		/// </summary>
		public override void Draw (RectangleF rect)
		{
			// if the control hasn't been setup yet
			if (activityIndicator == null)
			{
				// if we have a message
				if (!string.IsNullOrEmpty (message))
				{
					lblMessage = new UILabel (new RectangleF (20, 10, rect.Width - 40, 33));
					lblMessage.BackgroundColor = UIColor.Clear;
					lblMessage.TextColor = UIColor.LightTextColor;
					lblMessage.TextAlignment = UITextAlignment.Center;
					lblMessage.Text = message;
					this.AddSubview (lblMessage);
				}
				
				// instantiate a new activity indicator
				activityIndicator = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.White);
				activityIndicator.Frame = new RectangleF ((rect.Width / 2) - (activityIndicator.Frame.Width / 2)
					, 50, activityIndicator.Frame.Width, activityIndicator.Frame.Height);
				this.AddSubview (activityIndicator);
				activityIndicator.StartAnimating ();
			}
			base.Draw (rect);		
		}
开发者ID:Adameg,项目名称:mobile-samples,代码行数:29,代码来源:ActivityIndicatorAlertView.cs

示例4: ViewDidAppear

        public override void ViewDidAppear(bool animated)
        {
            //			if (_isLoaded)
            //			{
            //				DidRotate(new UIInterfaceOrientation());
            //				return;
            //			}

            base.ViewDidAppear (animated);

            AddComponents ();

            Init ();

            var lbl = new UILabel (new RectangleF(100,0,100,30));
            lbl.Text = "Загрузка";
            lbl.BackgroundColor = UIColor.FromRGBA (0, 0, 0, 0);
            lbl.TextColor = UIColor.White;
            var activitySpinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
            activitySpinner.Frame = new RectangleF (0,-35,50,50);
            activitySpinner.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
            activitySpinner.StartAnimating ();
            _alert = new UIAlertView();
            _alert.Frame.Size = new SizeF (60, 60);
            _alert.AddSubview(activitySpinner);
            _alert.AddSubview (lbl);
            _alert.Show();
            _twitterConection.GeTwittstByTag(_tag, GetNumberOfRows());
            _isSelected = false;
        }
开发者ID:RoTTex,项目名称:FirstMy,代码行数:30,代码来源:HomeScreen.cs

示例5: 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

示例6: LoadingAlertView

        public LoadingAlertView(System.Drawing.RectangleF frame)
            : base(frame)
        {
            // configurable bits
            AutoresizingMask = UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleLeftMargin;

            Title = "TwitterBot";
            Message = "Загрузка данных...";

            // derive the center x and y
            float centerX = Frame.Width / 2;
            float centerY = Frame.Height / 2;

            var f = Frame;
            f.Height = Frame.Height;
            Frame = f;

            // create the activity spinner, center it horizontall and put it 5 points above center x
            if (UIDevice.CurrentDevice.CheckSystemVersion (6, 0)) {
                activitySpinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
                activitySpinner.Frame = new System.Drawing.RectangleF (
                    centerX - (activitySpinner.Frame.Width / 2),
                    centerY + Frame.Height / 4 - activitySpinner.Frame.Height / 2,
                    activitySpinner.Frame.Width,
                    activitySpinner.Frame.Height);
                activitySpinner.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
                AddSubview (activitySpinner);
                activitySpinner.StartAnimating ();
            }
        }
开发者ID:GonzRu,项目名称:TwitterBot,代码行数:30,代码来源:LoadingAlertView.cs

示例7: ViewDidLoad

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

            _thread = new Thread(ThreadEntry);

            // Container for the controls
            _containerView = new UIView();
            _containerView.Frame = new RectangleF(0,-20,320,480);

            // The background loading image
            _imageView = new UIImageView();
            _imageView.Image = UIImage.FromFile("Default.png");
            _imageView.Frame = new RectangleF(0,0,320,480);
            _containerView.AddSubview(_imageView);

            // The pulser
            _activityView = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White);
            _activityView.Frame = new RectangleF(115,280,20,20);
            _containerView.AddSubview(_activityView);
            _activityView.StartAnimating();

            // Label saying wait
            _label = new UILabel();
            _label.Frame = new RectangleF(140,280,250,20);
            _label.Font = UIFont.SystemFontOfSize(14f);
            _label.BackgroundColor = UIColor.Clear;
            _label.TextColor = UIColor.White;
            _label.ShadowColor = UIColor.Black;
            _label.Text = "Loading...";
            _containerView.AddSubview(_label);

            View.AddSubview(_containerView);
        }
开发者ID:yetanotherchris,项目名称:really-simple,代码行数:34,代码来源:SplashScreenController.cs

示例8: 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

示例9: ViewDidLoad

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

            // don't allow anything if there isn't a watchUrl set
            if ( MediaUrl == null )
            {
                throw new Exception( "MediaUrl must not be null!" );
            }

            // setup our activity indicator
            ActivityIndicator = new UIActivityIndicatorView();
            ActivityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.White;
            ActivityIndicator.SizeToFit( );
            ActivityIndicator.StartAnimating( );

            PreloadFinished = false;

            // create the movie player control
            MoviePlayer = new MPMoviePlayerController( );
            View.AddSubview( MoviePlayer.View );

            View.AddSubview( ActivityIndicator );

            ResultView = new UIResultView( View, View.Frame.ToRectF( ), delegate { TryPlayMedia( ); } );
        }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:26,代码来源:NotesWatchUIViewController.cs

示例10: 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

示例11: SetUpActivityIndicator

		void SetUpActivityIndicator ()
		{
			activityIndicator = new UIActivityIndicatorView (new CGRect (150f, 220f, 20f, 20f));
			if (AppDelegate.IsPad)
				activityIndicator.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
			activityIndicator.StartAnimating ();
		}
开发者ID:topcbl,项目名称:mobile-samples,代码行数:7,代码来源:UILoadingVIew.cs

示例12: 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

示例13: ViewDidLoad

		public override void ViewDidLoad ()
		{
			loadingBg = new UIView (this.View.Frame) { BackgroundColor = UIColor.Black };
			loadingView = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
			loadingView.Frame = new RectangleF ((this.View.Frame.Width - loadingView.Frame.Width) / 2, 
				(this.View.Frame.Height - loadingView.Frame.Height) / 2,
				loadingView.Frame.Width, 
				loadingView.Frame.Height);			

			loadingBg.AddSubview (loadingView);
			View.AddSubview (loadingBg);
			loadingView.StartAnimating ();

			scannerView = new ZXingScannerView(new RectangleF(0, 0, this.View.Frame.Width, this.View.Frame.Height));
			scannerView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
			scannerView.UseCustomOverlayView = this.Scanner.UseCustomOverlay;
			scannerView.CustomOverlayView = this.Scanner.CustomOverlay;
			scannerView.TopText = this.Scanner.TopText;
			scannerView.BottomText = this.Scanner.BottomText;
			scannerView.CancelButtonText = this.Scanner.CancelButtonText;
			scannerView.FlashButtonText = this.Scanner.FlashButtonText;

			//this.View.AddSubview(scannerView);
			this.View.InsertSubviewBelow (scannerView, loadingView);

			this.View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
		}
开发者ID:Woo-Long,项目名称:ZXing.Net.Mobile,代码行数:27,代码来源:ZXingScannerViewController.cs

示例14: BusyIndicatorClass

		public BusyIndicatorClass (CGRect frame,string strMsg ) :base(frame)
		{
			BackgroundColor = UIColor.Black;
			Alpha = 0.50f; 
			const float flLabelHeight=22;

			float flWidth=Convert.ToSingle(Frame.Width.ToString());
			float flHeight= Convert.ToSingle(Frame.Height.ToString());

			float flLabelWidth=flWidth-20;
			float flCenterX=flWidth/2;
			float flCenterY=flHeight/2;

			spinner= new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White);
			spinner.Frame= new CGRect(flCenterX - ( spinner.Frame.Width / 2 ) , flCenterY - spinner.Frame.Height - 20 , spinner.Frame.Width , spinner.Frame.Height );
			spinner.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
			AddSubview ( spinner );
			spinner.StartAnimating ();

			lblLoading= new UILabel(new CGRect (flCenterX - ( flLabelWidth / 2 ) , flCenterY + 20 , flLabelWidth , flLabelHeight ) );
			lblLoading.BackgroundColor = UIColor.Clear;
			lblLoading.Text = strMsg;
			lblLoading.TextAlignment = UITextAlignment.Center;
			lblLoading.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
			AddSubview ( lblLoading );
 
		}
开发者ID:suchithm,项目名称:SqliteDemo.iOS,代码行数:27,代码来源:BusyIndicatorClass.cs

示例15: LoadingOverlay

    public LoadingOverlay (CGRect frame, string text) : base (frame)
		{
			BackgroundColor = UIColor.Black;
			Alpha = 0.75f;
			AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;

      nfloat labelHeight = 22;
      nfloat labelWidth = Frame.Width - 20;

      nfloat centerX = Frame.Width / 2;
      nfloat centerY = Frame.Height / 2;

			activitySpinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge);
      activitySpinner.Frame = new CGRect(
				centerX - (activitySpinner.Frame.Width / 2) ,
				centerY - activitySpinner.Frame.Height - 20 ,
				activitySpinner.Frame.Width ,
				activitySpinner.Frame.Height);
			activitySpinner.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
			AddSubview (activitySpinner);
			activitySpinner.StartAnimating ();

      loadingLabel = new UILabel(new CGRect (
				centerX - (labelWidth / 2),
				centerY + 20 ,
				labelWidth ,
				labelHeight
			));
			loadingLabel.BackgroundColor = UIColor.Clear;
			loadingLabel.TextColor = UIColor.White;
			loadingLabel.Text = text;
			loadingLabel.TextAlignment = UITextAlignment.Center;
			loadingLabel.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
			AddSubview (loadingLabel);
		}
开发者ID:amatkivskiy,项目名称:sitecore-xamarin-pcl-sdk,代码行数:35,代码来源:LoadingOverlay.cs


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