Note that there are some explanatory texts on larger screens.

plurals
  1. POMonoTouch: very simple webView code
    primarykey
    data
    text
    <p>I'm creating some web/native hybrid iOS App with some C# background task on MonoTouch.</p> <p>For a starter, I tried to create very simple webView sample referring </p> <ul> <li><a href="http://docs.xamarin.com/recipes/ios/content_controls/web_view/load_local_content/" rel="nofollow">http://docs.xamarin.com/recipes/ios/content_controls/web_view/load_local_content/</a></li> <li><a href="http://docs.xamarin.com/recipes/ios/content_controls/web_view/load_local_content/Resources/Loading_Local_Content_(WebView).zip" rel="nofollow">http://docs.xamarin.com/recipes/ios/content_controls/web_view/load_local_content/Resources/Loading_Local_Content_(WebView).zip</a></li> </ul> <p>(The above sample project code works, but I just need a webView without NavigatorView) and</p> <ul> <li><a href="http://yobriefca.se/blog/2011/12/05/rolling-your-own-phonegap-with-monotouch/" rel="nofollow">http://yobriefca.se/blog/2011/12/05/rolling-your-own-phonegap-with-monotouch/</a></li> </ul> <p>My code so far is:</p> <p><strong>AppDelegate.cs</strong></p> <pre><code>using System; using MonoTouch.Foundation; using MonoTouch.UIKit; namespace iostest { [Register ("AppDelegate")] public partial class AppDelegate : UIApplicationDelegate { UIWindow window; public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); window.RootViewController = new WebViewController(); // make the window visible 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 iostest { public class WebViewController : UIViewController { UIWebView webView; public override void ViewDidLoad () { base.ViewDidLoad (); Console.WriteLine ("WebView Launched"); //this works webView = new UIWebView(View.Bounds); webView.ScalesPageToFit = false; webView.LoadRequest (new NSUrlRequest (new NSUrl (Path.Combine(NSBundle.MainBundle.BundlePath, "www/app.html"), false))); this.View.AddSubview(webView); } } } </code></pre> <p>This code runs without an error, but results with only a blank white page, without showing my HTML content "www/app.html" (or, "<a href="http://google.com" rel="nofollow">http://google.com</a>" whatever).</p> <p>I don't see what logic I miss. Any thought? Thanks.</p>
    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