• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIActivityIndicatorView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: LoadingIndicator

		private LoadingIndicator() : base()
		{
			int ScreenWidth = Platform.ScreenWidth;
			int ScreenHeight = Platform.ScreenHeight - 80;
			const int Padding = 10;
			const int TextWidth = 65;
			const int SpinnerSize = 20;
			const int SeparateWidth = 5;
			const int Width = Padding + SpinnerSize + SeparateWidth + TextWidth + Padding;
			const int Height = Padding + SpinnerSize + Padding;
		
			Frame = new RectangleF((ScreenWidth - Width) / 2, ScreenHeight / 2, Width, Height);
			BackgroundColor = UIColor.FromWhiteAlpha(0.5f, 0.5f);
			
			spinner = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge)
            {
				Frame = new RectangleF(Padding, Padding, SpinnerSize, SpinnerSize)
			};
			
			label = new UILabel
            {
				Frame = new RectangleF(Padding + SpinnerSize + SeparateWidth, Padding, TextWidth, SpinnerSize),
				Text = "Loading...",
				TextColor = StyleExtensions.lightGrayText,
				BackgroundColor = StyleExtensions.transparent,
				AdjustsFontSizeToFitWidth = true
			};
			
			AddSubview(label);
			AddSubview(spinner);
			
			Hidden = true;
		}
开发者ID:Smeedee,项目名称:Smeedee-Mobile,代码行数:33,代码来源:LoadingIndicator.cs


示例2: ViewDidLoad

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

            //this.View.BackgroundColor = UIColor.Black;

            _activityView = new UIActivityIndicatorView(this.View.Frame);
            //Add(_activityView);
            //View.BringSubviewToFront(_activityView);

            _tableView = new FoldingTableViewController(new System.Drawing.RectangleF(0, 0, 320, 367), UITableViewStyle.Plain);
            var source = new TableSource(_tableView.TableView);

            this.AddBindings(new Dictionary<object, string>()
                                 {
                                     {source, "ItemsSource TweetsPlus"},
                                     //{_activityView, "{'Hidden':{'Path':'IsSearching','Converter':'InvertedVisibility'}}"},
				{_tableView, "Refreshing IsSearching;RefreshHeadCommand RefreshCommand;LastUpdatedText WhenLastUpdatedUtc,Converter=SimpleDate"},
                                 });

            _tableView.TableView.RowHeight = 100;
            _tableView.TableView.Source = source;
            _tableView.TableView.ReloadData();
            this.Add(_tableView.View);

            NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("Tweet", UIBarButtonItemStyle.Bordered, (sender, e) => ViewModel.DoShareGeneral()), false);
        }
开发者ID:Dexyon,项目名称:MvvmCross-Samples,代码行数:27,代码来源:TwitterView.cs


示例3: ProgressLabel

		public ProgressLabel (string text)
			: base (new RectangleF (0, 0, 200, 44))
		{
			BackgroundColor = UIColor.Clear;
			
			activity = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.White) {
				Frame = new RectangleF (0, 11.5f, 21, 21),
				HidesWhenStopped = false,
				Hidden = false,
			};
			AddSubview (activity);
			
			var label = new UILabel () {
				Text = text,
				TextColor = UIColor.White,
				Font = UIFont.BoldSystemFontOfSize (20),
				BackgroundColor = UIColor.Clear,
				Frame = new CGRect (25, 0, Frame.Width - 25, 44),
			};
			AddSubview (label);
			
			var f = Frame;
			f.Width = label.Frame.X + label.Text.StringSize (label.Font).Width;
			Frame = f;
		}
开发者ID:chasd00,项目名称:SalesforceSDK,代码行数:25,代码来源:ProgressLabel.cs


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


示例5: 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:rajeshwarn,项目名称:GhostPractice-iPadRepo,代码行数:29,代码来源:ActivityIndicatorAlertView.cs


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


示例7: ViewDidLoad

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

            _loadDataButton = UIButton.FromType(UIButtonType.RoundedRect);
            _loadDataButton.SetTitle("Hent sanntidsdata", UIControlState.Normal);
            _loadDataButton.Frame = new RectangleF(10, 10, View.Bounds.Width - 20, 50);

            _result = new UITextView(new RectangleF(10, 70, View.Bounds.Width - 20, View.Bounds.Height - 80));
            _result.Font = UIFont.FromName("Arial", 14);
            _result.Editable = false;

            _activityIndicator = new UIActivityIndicatorView(new RectangleF(View.Bounds.Width / 2 - 20, View.Bounds.Height / 2 - 20, 40, 40));
            _activityIndicator.AutoresizingMask = UIViewAutoresizing.FlexibleBottomMargin | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin;
            _activityIndicator.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;

            View.AddSubview(_activityIndicator);
            View.AddSubview(_loadDataButton);
            View.AddSubview(_result);

            View.BackgroundColor = UIColor.DarkGray;

            _loadDataButton.TouchUpInside += delegate(object sender, EventArgs e) {
                if(_location != null)
                {
                    _activityIndicator.StartAnimating();
                    _result.Text = "Jobber..." + Environment.NewLine + Environment.NewLine;
                    var coordinate = new GeographicCoordinate(_location.Latitude, _location.Longtitude);
                    ThreadPool.QueueUserWorkItem(o => _sanntid.GetNearbyStops(coordinate, BusStopsLoaded));
                }
            };

            _gpsService.LocationChanged = location => _location = location;
            _gpsService.Start();
        }
开发者ID:runegri,项目名称:MuPP,代码行数:35,代码来源:SanntidView.cs


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


示例9: BuildHud

        static void BuildHud()
        {
            if (hud == null) {
                hud = new UIView (UIApplication.SharedApplication.KeyWindow.RootViewController.View.Frame) {
                    BackgroundColor = UIColor.Black,
                    Alpha = 0.8f,
                    AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight
                };

                activity = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge) {
                    Frame = new RectangleF (hud.Frame.Width / 2 - HUD_SIZE / 2, hud.Frame.Height / 2 - HUD_SIZE / 2 - LABEL_HEIGHT / 2 - 5f, HUD_SIZE, HUD_SIZE),
                    AutoresizingMask = UIViewAutoresizing.FlexibleMargins
                };

                label = new UILabel {
                    Frame = new RectangleF (0f, activity.Frame.Bottom + 10f, hud.Frame.Width, LABEL_HEIGHT),
                    TextAlignment = UITextAlignment.Center,
                    Font = UIFont.BoldSystemFontOfSize (18.0f),
                    AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin,
                    TextColor = UIColor.White

                };

                hud.AddSubview (activity);
                hud.AddSubview (label);

                //label = new UILabel (new RectangleF (0,  hud.Frame.Width,
            }
        }
开发者ID:Redth,项目名称:crisischeckin,代码行数:29,代码来源:ProgressHud.cs


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


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


示例12: ActivityIndicator

		public ActivityIndicator ()
		{
			Opaque = false;

			var bounds = new CGRect (0, 0, 150, 44);
			Frame = bounds;

			var isDark = DocumentAppDelegate.Shared.Theme.IsDark;
			BackgroundColor = isDark ?
				UIColor.FromWhiteAlpha (1-0.96f, 0.85f) :
				UIColor.FromWhiteAlpha (0.96f, 0.85f);
			Layer.CornerRadius = 12;

			const float margin = 12;

			activity = new UIActivityIndicatorView (isDark ? UIActivityIndicatorViewStyle.White : UIActivityIndicatorViewStyle.Gray) {
				Frame = new CGRect (margin, margin, 21, 21),
				HidesWhenStopped = false,
			};

			titleLabel = new UILabel (new CGRect (activity.Frame.Right+margin, 0, bounds.Width - activity.Frame.Right - 2*margin, 44)) {
				TextAlignment = UITextAlignment.Center,
				TextColor = isDark ? UIColor.FromWhiteAlpha (1-0.33f, 1) : UIColor.FromWhiteAlpha (0.33f, 1),
				BackgroundColor = UIColor.Clear,
			};

			AddSubviews (titleLabel, activity);
		}
开发者ID:praeclarum,项目名称:Praeclarum,代码行数:28,代码来源:ActivityIndicator.cs


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


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


示例15: ProgressLabel

		public ProgressLabel (string text)
			: base (new RectangleF (0, 0, 200, 44))
		{
			BackgroundColor = UIColor.Clear;
			
			activity = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.White) {
				Frame = new RectangleF (0, 11.5f, 21, 21),
				HidesWhenStopped = false,
				Hidden = false,
			};
			AddSubview (activity);
			
			var label = new UILabel () {
				Text = text,
				TextColor = UIColor.White,
				Font = UIFont.BoldSystemFontOfSize (20),
				BackgroundColor = UIColor.Clear,
				#if ! __UNIFIED__
				Frame = new RectangleF (25f, 0f, Frame.Width - 25, 44f),
				#else
				Frame = new RectangleF (25f, 0f, (float)(Frame.Width - 25), 44f),
				#endif
			};
			AddSubview (label);
			
			var f = Frame;
			f.Width = label.Frame.X + UIStringDrawing.StringSize (label.Text, label.Font).Width;
			Frame = f;
		}
开发者ID:nissan,项目名称:Xamarin.Social,代码行数:29,代码来源:ProgressLabel.cs


示例16: ViewDidLoad

    public override void ViewDidLoad()
    {
      base.ViewDidLoad();
      EdgesForExtendedLayout = UIRectEdge.None;
      ExtendedLayoutIncludesOpaqueBars = false;
      AutomaticallyAdjustsScrollViewInsets = false;


      NavigationController.NavigationBar.BarStyle = UIBarStyle.Black;
      this.RefreshControl = new UIRefreshControl();

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


      RefreshControl.ValueChanged += async (sender, args) =>
      {
        if (viewModel.IsBusy)
          return;

        await viewModel.GetContactsAsync();
        TableView.ReloadData();
      };

      viewModel.PropertyChanged += PropertyChanged;

      TableView.Source = new ContactsSource(viewModel, this);
    }
开发者ID:gxy001,项目名称:Office365-FiveMinuteMeeting,代码行数:30,代码来源:ContactsViewController.cs


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


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


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


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UIAlertView类代码示例发布时间:2022-05-24
下一篇:
C# UIActionSheet类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap