// // Web sample in C#v // using System; using MonoTouch.UIKit; using MonoTouch.Foundation; using System.Drawing; public class WebViewController : UIViewController { UIWebView web; // Load our definition from the NIB file public WebViewController () : base ("WebViewController", null) { } [Connect] public UIView view { get { return (UIView) GetNativeField ("view"); } set { SetNativeField ("view", value); } } public override void ViewWillDisappear (bool animated) { web.StopLoading (); web.Delegate = null; UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false; } public override bool ShouldAutorotateToInterfaceOrientation (UIInterfaceOrientation toInterfaceOrientation) { return true; } public override void ViewDidLoad () { Title = "Web"; var webFrame = UIScreen.MainScreen.ApplicationFrame; webFrame.Y += 25f; webFrame.Height -= 40f; web = new UIWebView (webFrame) { BackgroundColor = UIColor.White, ScalesPageToFit = true, AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight }; web.LoadStarted += delegate { UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true; }; web.LoadFinished += delegate { UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false; }; web.LoadError += (webview, args) => { UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false; web.LoadHtmlString (String.Format ("