Guest User

Untitled

a guest
Jun 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Text;
  5. using MonoTouch.Foundation;
  6. using MonoTouch.UIKit;
  7.  
  8. namespace UI
  9. {
  10. public class PageViewController: UIViewController
  11. {
  12. Uri page;
  13.  
  14. public PageViewController(Uri page, string title) : base()
  15. {
  16. this.page = page;
  17. this.Title = title;
  18. }
  19.  
  20. public UIWebView webView;
  21.  
  22. public override void ViewDidLoad()
  23. {
  24. //base.ViewDidLoad();
  25.  
  26. var webFrame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height - 44);
  27.  
  28. webView = new UIWebView (webFrame) {
  29. BackgroundColor = UIColor.White,
  30. ScalesPageToFit = true,
  31. AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight,
  32. ContentMode = UIViewContentMode.ScaleToFill
  33. };
  34.  
  35. webView.LoadStarted += delegate {
  36. UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
  37. };
  38. webView.LoadFinished += delegate {
  39. UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
  40. };
  41.  
  42. this.View.AddSubview(webView);
  43.  
  44. webView.LoadRequest(NSUrlRequest.FromUrl(new NSUrl(page.AbsoluteUri)));
  45. }
  46. }
  47. }
Add Comment
Please, Sign In to add comment