This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathImagesViewController.xib.cs
68 lines (57 loc) · 1.69 KB
/
ImagesViewController.xib.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// Images sample port to C#/MonoTouch
//
using System;
using UIKit;
using Foundation;
namespace MonoCatalog {
public partial class ImagesViewController : UIViewController {
// Loads the inteface from the NIB file.
public ImagesViewController () : base ("ImagesViewController", null)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
Title = "Images";
imageView.AnimationImages = new UIImage [] {
UIImage.FromFile ("images/scene1.jpg"),
UIImage.FromFile ("images/scene2.jpg"),
UIImage.FromFile ("images/scene3.jpg"),
UIImage.FromFile ("images/scene4.jpg"),
UIImage.FromFile ("images/scene5.jpg")
};
imageView.AnimationDuration = 5;
imageView.StopAnimating ();
}
//
// Try to clean up resources to assist the GC, this is called
// in response to low-memory conditions
//
public override void ViewDidUnload ()
{
base.ViewDidUnload ();
imageView = null;
slider = null;
}
partial void sliderAction (UISlider sender)
{
imageView.AnimationDuration = sender.Value;
if (!imageView.IsAnimating)
imageView.StartAnimating ();
}
public override void ViewWillDisappear (bool animated)
{
imageView.StopAnimating ();
NavigationController.NavigationBar.BarStyle = UIBarStyle.Default;
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default;
}
public override void ViewWillAppear (bool animated)
{
imageView.StartAnimating ();
// for aesthetic reasons (the background is black), make the nav bar black for this particular page
NavigationController.NavigationBar.BarStyle = UIBarStyle.Black;
UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;
}
}
}