Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>OK, things has been fuzzy, but I resolved by myself.</p> <p>The problem is the local resource files ("www/app.html") should be flagged as 'content' at BuildAction Property of IDE.</p> <p>I remember I was trapped by this a few years ago, and still see many people are trapped.</p> <p>Lack of documentation cause wasting time. Please document Xamarin.</p> <p>The current code for future reference:</p> <p><strong>AppDelegate.cs</strong></p> <pre><code>using System; //using System.Collections.Generic; //using System.Linq; using MonoTouch.Foundation; using MonoTouch.UIKit; namespace iOStest2 { [Register ("AppDelegate")] public partial class AppDelegate : UIApplicationDelegate { UIWindow window; public override bool FinishedLaunching (UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); window.RootViewController = new WebViewController (); window.MakeKeyAndVisible (); return true; } } } </code></pre> <p><strong>WebViewController.cs</strong></p> <pre><code>using System; using System.IO; using MonoTouch.Foundation; using MonoTouch.UIKit; namespace iOStest2 { public class WebViewController : UIViewController { UIWebView webView; public override void ViewDidLoad () { base.ViewDidLoad (); Console.WriteLine ("WebView Launched"); View.BackgroundColor = UIColor.Gray; //string url = "http://google.com"; string url= Path.Combine(NSBundle.MainBundle.BundlePath, "Content/app.html"); webView = new UIWebView(View.Bounds); webView.LoadRequest(new NSUrlRequest(new NSUrl(url,false))); webView.ScalesPageToFit = false; View.AddSubview(webView); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload