本文整理汇总了C#中UIActivityIndicatorView类的典型用法代码示例。如果您正苦于以下问题:C# UIActivityIndicatorView类的具体用法?C# UIActivityIndicatorView怎么用?C# UIActivityIndicatorView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UIActivityIndicatorView类属于命名空间,在下文中一共展示了UIActivityIndicatorView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
示例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;
}
示例4: SetUpActivityIndicator
void SetUpActivityIndicator ()
{
activityIndicator = new UIActivityIndicatorView (new CGRect (150f, 220f, 20f, 20f));
if (AppDelegate.IsPad)
activityIndicator.AutoresizingMask = UIViewAutoresizing.FlexibleMargins;
activityIndicator.StartAnimating ();
}
示例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);
}
示例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;
}
}
示例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();
}
示例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;
}
示例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,
}
}
示例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;
}
示例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 );
}
示例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);
}
示例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();
};
}
示例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);
}
示例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;
}