How does one present a modal view using PhoneGap?

Having made a few iOS apps, I'm now taking my first steps in building a HTML5 app with PhoneGap.

One of the things that has stumped me is how to present a modal view. In iOS it's trivial:

[myViewController presentModalViewController:modalViewController animated:YES];

But after a bit of Googling, and checking out PhoneGap's API reference, I can't find a single example of how to present a modal view...something I thought would be a trivial task with 100s of tutorials.

Or maybe I'm just really bad at Googling! I think however, that I'm missing something blindingly obvious...

Answers


there is no presentModalViewController for phonegap, in phonegap you load all your code in a "webView", and all the code and page transitions have to be done with html+css+javascript, so you have to create your own flip, crossdisolve and other animations (or use jquery mobile, jqtouch, jqmobi or any other javascript framework with this animations), so you can reuse the code in other platforms, you don't have presentModalViewController on android or blackberry.

If you really want to use presentModalViewController on a iOS phonegap app, you have to create a plugin, or use phonegap as a component, then you create different views, loading different html files on them, and change betweem them with native code.


This will help you to

http://malsup.com/jquery/block/#dialog


I much rather use bootstrap (http://getbootstrap.com/javascript/)

$('#myModal').modal('show')


Need Your Help

MoreLikeThis not returning 100% score rate in Lucene.Net when comparing the same document with each other

lucene lucene.net morelikethis

I don't know if I am calling Lucene.net correctly. I'm trying to call the MoreLikeThis function to compare a document to itself and I'm only getting a score of 0.3174651 where I think I should be g...