本文整理汇总了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 ();
}
示例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 ();
}
示例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 ();
}
示例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);
}
示例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;
}
示例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();
}
示例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;
//.........这里部分代码省略.........
示例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));
}